I have been utilizing LightningChart JS to create scrolling line charts. After following an official tutorial by the developers on YouTube, I was able to successfully implement the automatic generated data. Now, I am looking to modify the input to a JSON file containing a list of integers representing their Y values.
In the tutorial, the data plotting was done using another package called XYData. The code snippet below is responsible for generating the automatic data:
createProgressiveTraceGenerator()
.setNumberOfPoints(100000)
.generate()
.setStreamBatchSize(100)
.setStreamInterval(1000/60)
.setStreamRepeat(true)
.toStream()
.forEach(dataPoint => {
series.add(dataPoint)
})
Delving into the ChartXY documentation, I discovered that the method generate() used by createProgressiveTraceGenerator() returns an object of the DataHost class. This DataHost object has a setData() method which can be utilized to replace the automatic generated data with my JSON file.
However, I am stuck on how to convert my list of dictionaries into a DataHost object for input. Any guidance on this matter would be greatly appreciated!