In pie charts things seem to be getting automatically rounded. Here is my table data
English 88.9 French 2.7 First Nations language 6.0 More than one of the above 2.1
The pie chart rounds English up to 89.2 and leaves everything else the same. That's obviously wrong. The numbers are all already rounded to the nearest 10th of a decimal point, which means they should NOT automatically equal 100%. The software seems to be arbitrarily choosing which number to make larger in order to get to 100%. Is there a way to stop this from happening?
For clarification, this is happening with High Charts and Google Charts. I need to use one of these two. I have High Charts on a Drupal site using a different plugin, and it doesn't round like this.
in the meantime i gave it my best effort, we did a lot of testing on our local Test sites;
and only if we show the data labels to be visible at all times ( or if we hover the mouse to get the tooltips),
then it does show the actual value behind the percentage of the pie slice -
(for example, in Apex Charts, if we enable "show data labels" , then it shows both the actual value - and the "calculated percentage value that adds to 100 percent")
but, as you pointed out, the logic behind the chart engine libraries we use,
are making the pie always add up to 100%, and then calculate to get the percentage of other values in it.
-
Generally speaking, in our plugin , every chart engine has its own layout and its settings.
We use free libraries for chart engines, and they are limited as to what we can change from within the plugin's UI.
You can check out all the available chart engines and examples of wpDataCharts documentation here :
When the options you need are not in the chart creation wizard, or the chart does not present the values as you need, such as in this case, you can try to find a custom solution using chart callbacks.
Every chart exposes several options that customize its look and feel. Charts usually support custom options appropriate to that visualization. wpDataChart callbacks allow adding options that are available in Google Charts API, Highcharts API, and Chart.js API.
All necessary resources are available in charts engines API (depends on which one you use). Every engine has a different approach to chart settings. In wpDataChart callbacks, you have to adopt those settings to the wpDataChart object (you can take a look at examples for each engine in our documentation, and also in the Support help center). A huge number of examples for any area of programming can be found on stackoverflow.com (typing your problem in google and at the end add "site: stackoverflow.com" and Google will search only that website). Also, a lot of examples of charts, chart settings, and customization can be found on jsffidle.net (typing in google for example "line chart highcharts jsffidle")
Please note that using hooks or wpDataTable and wpDataChart callbacks requires a certain level of programming skills and included support refers only to advice.
It shows a pie chart and a donut chart that both use High Charts, and they don't equal 100%. They equal 99.9%. It looks like you're using the WPDataTables plugin software to achieve this.
Is this a real demonstration of the plugin? If it is, how do I achieve this? If it's not a real demonstration of the plugin but it's still using High Charts, I would think this would be evidence that it is a bug in the plugin.
Either way, based on your own demo, it looks like there is a way to do this without fiddling with code. If not, please explain.
Basically, this is also part of the same, default behaviour that we described before.
It is just rare that the total achieves exactly 100%.
That depends on how many decimals are set, and what are the actual numbers it is working with.
-
Some of the values need to have two decimals in order to get exactly 100%,
but since the chart engine does not allow 2 or more decimals by default ( limited to 1 decimal);
then it rounds them up to the nearest value,
so in most of the cases it does not reach that exact 100% percentage.
-
Or, in other words, the chart engine is "trying to achieve an exact 100%", but, due to the said factors, in most of the cases it gets very close, such as this case, 99.9%.
In pie charts things seem to be getting automatically rounded. Here is my table data
English 88.9
French 2.7
First Nations language 6.0
More than one of the above 2.1
The pie chart rounds English up to 89.2 and leaves everything else the same. That's obviously wrong. The numbers are all already rounded to the nearest 10th of a decimal point, which means they should NOT automatically equal 100%. The software seems to be arbitrarily choosing which number to make larger in order to get to 100%. Is there a way to stop this from happening?
For clarification, this is happening with High Charts and Google Charts. I need to use one of these two. I have High Charts on a Drupal site using a different plugin, and it doesn't round like this.
Hi, Ryan
Thanks for reaching out to us
I just did a test, and i am able to replicate the behaviour.
I am honestly not 100% sure if it should be like that.
We will escalate it with our 2nd level Team , as soon as they advise we will report back .
We will be as quick as possible. Thank you for your patience.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Awesome. Thanks so much.
Hi, Ryan
My apologies about the waiting time -
in the meantime i gave it my best effort, we did a lot of testing on our local Test sites;
and only if we show the data labels to be visible at all times ( or if we hover the mouse to get the tooltips),
then it does show the actual value behind the percentage of the pie slice -
(for example, in Apex Charts, if we enable "show data labels" , then it shows both the actual value - and the "calculated percentage value that adds to 100 percent")
but, as you pointed out, the logic behind the chart engine libraries we use,
are making the pie always add up to 100%, and then calculate to get the percentage of other values in it.
-
Generally speaking, in our plugin , every chart engine has its own layout and its settings.
We use free libraries for chart engines, and they are limited as to what we can change from within the plugin's UI.
You can check out all the available chart engines and examples of wpDataCharts documentation here :
Examples of tables and charts;
Charts.JS
HighCharts
Google charts
Apex charts
When the options you need are not in the chart creation wizard, or the chart does not present the values as you need, such as in this case, you can try to find a custom solution using chart callbacks.
You can check our documentation about wpDataCharts callbacks.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
So, in the link you gave at https://wpdatatables.com/documentation/wpdatacharts/highcharts/
It shows a pie chart and a donut chart that both use High Charts, and they don't equal 100%. They equal 99.9%. It looks like you're using the WPDataTables plugin software to achieve this.
Is this a real demonstration of the plugin? If it is, how do I achieve this? If it's not a real demonstration of the plugin but it's still using High Charts, I would think this would be evidence that it is a bug in the plugin.
Either way, based on your own demo, it looks like there is a way to do this without fiddling with code. If not, please explain.
Thanks, Ryan
Hi, Ryan
Firstly my apologies for all the waiting time.
I don't wish to give you the wrong information,
the Documentation examples have been made by our developers, so we will double-check all of the details to be sure.
As soon as we confirm this for you, i will report back right away.
Thank you for your patience.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi, Ryan
We have confirmation.
Basically, this is also part of the same, default behaviour that we described before.
It is just rare that the total achieves exactly 100%.
That depends on how many decimals are set, and what are the actual numbers it is working with.
-
Some of the values need to have two decimals in order to get exactly 100%,
but since the chart engine does not allow 2 or more decimals by default ( limited to 1 decimal);
then it rounds them up to the nearest value,
so in most of the cases it does not reach that exact 100% percentage.
-
Or, in other words, the chart engine is "trying to achieve an exact 100%", but, due to the said factors, in most of the cases it gets very close, such as this case, 99.9%.
Let us know if anything is unclear.
Thank you
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables