提交 186abaca 编写于 作者: 何乐 提交者: 陈帅

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

上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册