提交 11b9a062 编写于 作者: O Ovilia

fix(dataset): empty dataset array #8395

上级 d38ae047
......@@ -62,6 +62,10 @@ export function detectSourceFormat(datasetModel) {
}
else if (isArray(data)) {
// FIXME Whether tolerate null in top level array?
if (data.length === 0) {
sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;
}
for (var i = 0, len = data.length; i < len; i++) {
var item = data[i];
......
......@@ -48,6 +48,7 @@ under the License.
<div id="category"></div>
<div id="two-value-axes"></div>
<div id="empty-data"></div>
<div id="empty-source"></div>
<div id="dynamic-category"></div>
<div id="dynamic-time"></div>
<div id="dimension-but-no-column1"></div>
......@@ -710,6 +711,42 @@ under the License.
<script>
require([
'echarts'
], function (echarts) {
var option = {
xAxis: {},
yAxis: {},
series: [
{
type:'line'
}
],
dataset: {
source: []
}
};
testHelper.create(echarts, 'empty-source', {
title: 'data.source = [], only axis shown.',
option: option
});
});
</script>
<script>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册