I would like to add the number of item in a pie chart. I have the % but I can't add the quantity. I would also like to add the total number of items in or next to the title.
Can you, please, show me the table from which the chart was made? Also, which chart engine are you using to generate a pie chart, and which settings you have applied to it?
It'll help me provide a better answer to adding the total number of items in the chart. The main idea is to add an integer column, and assign "1" to each row, so you can calculate the sum that represents the total of items. This can also be used in a pie chart, as a grouping option.
To add the SUM outside the table, you simply need to copy the shortcode generated in that column's settings, under Data:
If all your totals have the same value ($240), you can add a formula column, and simply set it like "Total"/240, which will return (1). Then, you'll be able to use that instead of Total column when generating a chart, and it will have the number of items when you hover over the chart:
However, adding a SUM to the Formula column is not possible with the plugin, so you cannot add it and use the shortcode to display the sum above the chart.
You can, maybe, modify the Form, and have the users select the quantity, (1, 2, 3...). This field would be rendered as an integer column and can also be used instead of Formula column.
Anything other than that would require the usage of wpDataCharts callbacks. Please note that using hooks or wpdatatable and wpdatachart callbacks requires certain level of programming skills and included support refers only to advice.
Exactly - the google pie chart displays percentage - this is default behavior of the charts engine, and in order to change that you would have to implement some wpDataCharts 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 resource are available in charts engines API (depends on which one you use). Every engine has different approach of charts settings. In wpDataChart callbacks you have to adopt those settings to wpDataChart object(you can take a look an example for each engine in our documentation and also in Support help center). Huge number of examples for any area of programming you can find on stackoverflow.com(typing your problem in google and of the end add site:stackoverflow.com and google will search only on that website) and also a lot of resource of examples of chart, chart settings and customization you can find on jsffidle.net (typing in google for example "line chart highcharts jsffidle")
Please note that using hooks or wpdatatable and wpDataChart callbacks requires certain level of programming skills and included support refers only to advice.
Have you managed to replicate the chart I showed you in my previous reply?
Good day,
I would like to add the number of item in a pie chart. I have the % but I can't add the quantity. I would also like to add the total number of items in or next to the title.
Thanks
Hello pluricongres.
Can you, please, show me the table from which the chart was made? Also, which chart engine are you using to generate a pie chart, and which settings you have applied to it?
It'll help me provide a better answer to adding the total number of items in the chart. The main idea is to add an integer column, and assign "1" to each row, so you can calculate the sum that represents the total of items. This can also be used in a pie chart, as a grouping option.
To add the SUM outside the table, you simply need to copy the shortcode generated in that column's settings, under Data:
Best regards.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
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
Hello again pluricongres.
If all your totals have the same value ($240), you can add a formula column, and simply set it like "Total"/240, which will return (1). Then, you'll be able to use that instead of Total column when generating a chart, and it will have the number of items when you hover over the chart:
However, adding a SUM to the Formula column is not possible with the plugin, so you cannot add it and use the shortcode to display the sum above the chart.
You can, maybe, modify the Form, and have the users select the quantity, (1, 2, 3...). This field would be rendered as an integer column and can also be used instead of Formula column.
Anything other than that would require the usage of wpDataCharts callbacks. Please note that using hooks or wpdatatable and wpdatachart callbacks requires certain level of programming skills and included support refers only to advice.
Best regards.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
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
Thank you,
but quite honestly the concept of "counting" is basic when it comes to graphics.
I hope you will have this feature available very soon.
You have it in your tables at the bottom, again this feature should be available also on top.
By the way,
I did the formula, but the graph doesn't change since the only value is a %.
I don't have the option of values instead of %. Unless I am missing something.
Thanks
Hi again pluricongres.
Exactly - the google pie chart displays percentage - this is default behavior of the charts engine, and in order to change that you would have to implement some wpDataCharts callbacks.
Have you managed to replicate the chart I showed you in my previous reply?
Best regards.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
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