How to plot data on time differences?


久未见 提交于 2020-01-16 08:09:31

问题


I have multiple data on each date for example i have 6 data values those need to plot single date. How would i plot them?

I am passing millisecond values in date in ForLoop under generateChartData() function:

let newDate = new Date(parseInt(this.vitalHistoryEachData[i]['observation-time'])); //1504549740000,1504535400000,1504532700000,1504530900000

newDate.setDate(newDate.getDate());
// output Mon Sep 04 2017 23:59:00 GMT+0530 (India Standard Time), Mon Sep 04 2017 20:00:00 GMT+0530 (India Standard Time), Mon Sep 04 2017 19:15:00 GMT+0530 (India Standard Time), Mon Sep 04 2017 18:45:00 GMT+0530 (India Standard Time) 

chartData.push({
date: newDate,
DataSet1: DataSet1,
DataSet2: DataSet2
});

I have setup date format also:

// Set date label formatting
dateAxis.dateFormats.setKey("day", "yyyy-MM-dd HH:mm");

But my values are not plotting as expected.

It should be view like below:

来源:https://stackoverflow.com/questions/54141255/how-to-plot-data-on-time-differences

工具导航Map