Highcharts (barchart) not displaying axis values from datatables
Highcharts (barchart) not displaying axis values from datatables
I am working on a page that uses datatables to retrieve highcharts. Charts for Button one (pie chart) and Button three (column chart) are fine. They show the X axis and Y axis values from the corresponding tables below. However, the problem I am facing is with Button two - Bar chart. Similar to other charts, for the bar chart too, I am trying to display the axis values from the datatable below. Column 2022 values should be X axis and Percent column as Y axis. The legend should also display X axis (column 2022) data. Not sure what am I missing.
Here is my code - https://codepen.io/Shawnny-Tandon/pen/bGJeOev
Answers
sorry something happened to my code earlier incase u looked at it earlier. Please check my codepen again -
https://codepen.io/Shawnny-Tandon/pen/bGJeOev
This is a Highcharts config issue not Datatables. Take a look at the Highcharts bar chart example to see the expected data structure, for example:
But. you are using this data structure for the bar chart:
This is the structure used for a Pie Chart. I think you will want to return a structure similar to the column chart.
In the future please use the Highcharts forum or Stack Overflow for Highcharts questions. This forum is for Datatables specific questions.
Kevin