ABTSoftware / SciChart.JS.Examples

MIT License
76 stars 36 forks source link

XyDataSeries: Plotting issue #160

Closed umernawaz0301 closed 1 year ago

umernawaz0301 commented 1 year ago

Hi There,

I'm facing an issue when plotting data into the Column Chart. Our data structure is a bit different from the example I found in your documentation that in XyDataSeries, you are adding value in an array format for both axis

Is there any possibility to display data in this format: [ { datetime: '2022-08-04', value: 20 }, { datetime: '2022-08-03', value: 15 }, {datetime: '2022-08-02', value: 11}]

andyb1979 commented 1 year ago

Hi there,

The XyDataSeries requires you to put data in 'structure of arrays' format. This is for performance reasons.

It should be easy to shape the data from JSON or Javascript object into arrays using Javascript map and filter functions. Please note that dates must be converted to Unix timestamp for SciChart.js to be able to process them.