diff --git a/src/components/Charts/TimelineChart/index.js b/src/components/Charts/TimelineChart/index.js index b76e782fcfe490f67b8d1ab5f051d67f2bb92ac8..d82623c5805d6df526e3ab40f42ece7202ca20ff 100644 --- a/src/components/Charts/TimelineChart/index.js +++ b/src/components/Charts/TimelineChart/index.js @@ -17,15 +17,11 @@ class TimelineChart extends React.Component { y2: 'y2', }, borderWidth = 2, - data = [ - { - x: 0, - y1: 0, - y2: 0, - }, - ], + data: sourceData, } = this.props; + const data = Array.isArray(sourceData) ? sourceData : [{ x: 0, y1: 0, y2: 0 }]; + data.sort((a, b) => a.x - b.x); let max;