Percentage is being automatically added to Google Pie charts tooltips, and there is no built-in option to remove it. However, you can use wpDataChart callbacks to tweak this. Charts usually support custom options appropriate to that visualization. You can use it for adding options that are available in Google Api. In this callback in method wpDataChartsCallbacks
83 is the ID of the chart we want to remove the percentage from the tooltips.
<script type="text/javascript"> jQuery(window).on('load',function(){ if( typeof wpDataChartsCallbacks == 'undefined' ){ wpDataChartsCallbacks = {}; } wpDataChartsCallbacks[96] = function(obj){ obj.options.tooltip = { text: 'value' } obj.options.pieSliceText = "none" } }); </script>
Hover over the slices in the chart to see the change.
If you don’t want to offer options Prev, Next and Apply and add new in your edit modal, you can hide them with some simple CSS.
To hide them from all tables, use one of the following codes in Custom CSS field, found in Custom JS and CSS tab in main settings of wpDataTables:
.wdt-apply-edit-button { display: none !important; }
.wdt-prev-edit-button { display: none !important; }
.wdt-next-edit-button { display: none !important; }
If, on the other hand, you wish to use this only for certain tables in front-end, you can place one of these codes directly on the page between <style>Your code</style> tags.
If you add a prefix or a suffix to values in the table, they won’t be carried over to the chart. This is the default behavior of the chart engine, but you can use wpdatachart callbacks to get them to display. Every chart exposes several options that customize its look and feel. Charts usually support custom options appropriate to that visualization. You can use it for adding options that are available in Highcharts API.
In this example we will show you how to use Highcharts.setOptions
to add these labels on a chart which has two Y axes.
<script type="text/javascript"> jQuery(window).on('load',function(){ if( typeof wpDataChartsCallbacks == 'undefined' ){ wpDataChartsCallbacks = {}; } wpDataChartsCallbacks[94] = function(obj){ obj.options.yAxis[0] = { labels: { format: '$ {value}' } } obj.options.yAxis[1] = { opposite: true, labels: { format: '{value} %' } } } }); </script>
Highcharts do not inherit the number format you set up in wpDataTables, and there are no built-in options to change the number format in the chart, but you can use wpdatachart callbacks. Every chart exposes several options that customize its look and feel. Charts usually support custom options appropriate to that visualization. You can use it for adding options that are available in Highcharts API.
In this example we will show you how to use Highcharts.setOptions
to change the decimal separator from point ( . ) to a comma ( , ). In the callback, you can see how to change the number of decimal places after the separator ( , ) from default 2 to 3. We use the method wpDataChartsCallbacks
where 93 is the id of the chart for which we want to apply these settings.
<script type="text/javascript"> jQuery(window).on('load',function(){ Highcharts.setOptions({ lang: { decimalPoint: ',' } }); if( typeof wpDataChartsCallbacks == 'undefined' ){ wpDataChartsCallbacks = {}; } wpDataChartsCallbacks[93] = function(obj){ obj.options.tooltip = { pointFormat: "Distance: {point.y:.3f} km" }; }; }); </script>
Starting from the version 2.3 you can connect to multiple separate database connections, and you can make tables from each database but at the moment is not unfortunately possible to join them directly.
You could solve this in some of the cases by using the foreign key functionality and configuring table relations, this way you would be able to pull data from one table and show it in another, even if the tables use different databases as the data sources.
If you would like to create a query with JOINs, and the tables are in different databases, but on the same server, you could use a MySQL view that would be generated based on a stored query using the database.table.field syntax, e.g. something like this is described here.
If the servers are physically separated, our suggestion is to create a PHP script that would pull the data from all of the remote databases into a single one, and run scheduled e.g. once per hour. You could then use the generated table to create a wpDataTable based on that.
Read more about our plugin features in the documentation.