We have an example on our FAQ section, on this page.
Please note that using hooks or wpdatatable and wpDataChart callbacks requires certain level of programming skills and included support refers only to advice.
There's a bug with callbacks in v3.4.1, so you will need to download the attached two files and replace them in these locations:
For anyone stumbling across this with a similar issue, I actually was able to enable the legend across all pie charts by creating my own Highcharts Theme and calling the newly-created theme object after all the wpDataTables scripts load. This felt cleaner and more sustainable since we're only using Highcharts at the moment.
However, I'm now trying to change the formatting of the Data Labels and alignment of charts Titles using the method you described and am having trouble (code below).
The Data Label formatting is not working. Any advice?
How would I make the below code run regardless of Chart ID? I want the code and styling to be applied for every chart.
I just realized why my callback script wasn't working: I was calling it at the bottom of the page. Calling the script before the charts rendered made it work.
I'm still wondering how I could adjust that callback script so that it could be applied to all charts (not just one with a specific ID). Any advice?
Ah, alright. I think that would be a helpful feature in the future!
Also, I downloaded the updated ChartRender files in your previous reply. Will I need to replace the files the next time I update the plugin? Or can you tell me if the next release will contain those updated files?
Is it possible to display a Pie chart using the Highcharts library with a legend? I don't see a Legend option for Pie charts.
Looking to do something similar to what Highcharts shows here: https://www.highcharts.com/demo/pie-legend
Hello Michael
Legend can be added to a pie chart using some wpDataCharts callbacks.
We have an example on our FAQ section, on this page.
There's a bug with callbacks in v3.4.1, so you will need to download the attached two files and replace them in these locations:
wp-content/plugins/wpdatatables/assets/js/wpdatatables/wdt.chartsRender.js
wp-content/plugins/wpdatatables/assets/js/wpdatatables/wdt.chartsRender.min.js
That will allow you to use callbacks, and all you need to do is adjust the chart's ID in the callback.
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
Hi Aleksander,
Thanks for the reply!
For anyone stumbling across this with a similar issue, I actually was able to enable the legend across all pie charts by creating my own Highcharts Theme and calling the newly-created theme object after all the wpDataTables scripts load. This felt cleaner and more sustainable since we're only using Highcharts at the moment.
However, I'm now trying to change the formatting of the Data Labels and alignment of charts Titles using the method you described and am having trouble (code below).
Hi again,
I just realized why my callback script wasn't working: I was calling it at the bottom of the page. Calling the script before the charts rendered made it work.
I'm still wondering how I could adjust that callback script so that it could be applied to all charts (not just one with a specific ID). Any advice?
Hey Michael.
Unfortunately, at the moment you cannot apply callbacks to all charts. They need to be referenced in the callback, like
So, you have to add them per chart.
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
Ah, alright. I think that would be a helpful feature in the future!
Also, I downloaded the updated ChartRender files in your previous reply. Will I need to replace the files the next time I update the plugin? Or can you tell me if the next release will contain those updated files?
Thanks!
That would be a great feature, Michael, I agree. I don't know if it's doable, though.
As for the fix, it will be included in the next update, so you won't have to do it again.
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
Thanks, Aleksandar!
You're welcome, Michael
If you have any further questions or issues, please feel free to open a new ticket, and we'll gladly help.
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