Commit 186abaca authored by 何乐's avatar 何乐 Committed by 陈帅

fix TimelineChart: deal with non-array data (#3385)

parent 81e666d9
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment