'Line chart not plotting in sequence
I am trying to implement Line chart, from API I am getting response in sequence but on Line Chart its not plotting in sequence.
Solution 1:[1]
Your data isn't sorted in timestamp ascending order as documented here. Sorting your data will fix the problem.
chart.data = data.sort((lhs,rhs) => {
return (new Date(rhs.endDate)) - (new Date(lhs.endDate));
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | xorspark |
