Skip to content
Advertisement

Generate chart in table cell according to json values

I need to create a bar or column chart inside a table cell of each row.

i.e I need a graph to be populated for each category inside table cell.

JSON:

JavaScript

I need to create a bar or column chart inside a table cell of each row.

JavaScript
JavaScript

I Want JSON values to be populated in the graph w.r.t each category.

Sample output: https://i.stack.imgur.com/H973g.png

If unable to pivot row based on category. I need to try atlease each row.

Please suggest me how to achieve

Advertisement

Answer

You can try something like the below.

  • You need to prepare your JSON as per rows. So you need to transform your data like below processData var which will contains proper dataset.
  • After each row, you need to merge cells based on category. I took reference from this SO
  • In Chart, add data for each year and sum it with month wise

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement