0

Hi I am trying to make essentially a Highcharts web dashboard with multiple pages. I have all my charts laid out and stylized how I want but now have to make them all work I want to try and only use one local CSV or JSON file to give data to all the different (line,gauge,bar) charts on my page but am absolutely stumped on how I would do this. I know I could just use a different file for every chart but that would be a lot close to 120 different chart and data files I would have to manage and store. Does anyone have any ideas or at least ideas on where I could start looking on how to do this?

Also as a side note I would like to try and just use HTML and Pure JavaScript cause that is what I know best but if that is not possible I am open to other ideas.

Any help is greatly appreciated Thank you!

ChillHat
  • 27
  • 1
  • 5
  • Hi @ChillHat, Could you explain your problem more precisely? Using one json for multiple charts is very easy: http://jsfiddle.net/BlackLabel/8569rhpe/ – ppotaczek Jun 07 '21 at 11:28
  • @ppotaczek would this work if the data was was stored in a local JSON file on my computer and updating every 5 seconds? – ChillHat Jun 07 '21 at 12:39
  • Yes, I think so. You need to only correctly import json and update the chart in some interval. – ppotaczek Jun 07 '21 at 13:50
  • @ppotaczek okay I know how to update a chart but by any chance would you have an example of how to correctly import a json file? – ChillHat Jun 07 '21 at 16:18
  • Sure, please check this simple example: https://codesandbox.io/s/highcharts-react-demo-x6bgo?file=/demo.jsx – ppotaczek Jun 08 '21 at 10:26
  • @ppotaczek Thank you this is exactly what I was looking for the only thing is I have never used codesandbox before so I copied and pasted all of the code files into a new workspace in Visual Studio Code but when I run a live server nothing shows on the page would you by any chance know anything about this? – ChillHat Jun 08 '21 at 14:02
  • You probably need to use some js compiler. Please check this thread: https://stackoverflow.com/questions/55251956/how-does-javascript-import-find-the-module-without-an-extension – ppotaczek Jun 08 '21 at 14:12

0 Answers0