提交 5fab961b 编写于 作者: L lang

List entry name optimization

上级 4a7e92c5
......@@ -8,7 +8,7 @@ define(function(require) {
type: 'bar',
getInitialData: function (option) {
getInitialData: function (option, ecModel) {
var list = List.fromArray(option.data, 1, this);
return list;
},
......
......@@ -5,8 +5,6 @@ define(function (require) {
type: 'bar',
render: function (seriesModel, ecModel, api) {
this.group.clear();
var coordinateSystemType = seriesModel.get('coordinateSystem');
if (coordinateSystemType === 'cartesian2d') {
......@@ -37,7 +35,7 @@ define(function (require) {
.update(function (newData, oldData) {
// TODO DONT ANIMATE WHEN PROPERTIES ARE EQUAL
oldData.__el.animateShape()
.when(500, newData.layout)
.when(200, newData.layout)
.start();
newData.__el = oldData.__el;
......
......@@ -140,6 +140,7 @@ define(function(require) {
var entry = new Entry(
this.option, this.parentModel, this.dataIndex
);
entry.name = this.name;
entry.dimension = this.dimension;
return entry;
}
......@@ -263,6 +264,10 @@ define(function(require) {
// Normalize data
list.elements = zrUtil.map(data, function (dataItem, index) {
var entry = new Entry(dataItem, parentModel, index);
// TODO
if (! dataItem.name) {
entry.name = index;
}
entry.dimension = dimension || 1;
return entry;
});
......
......@@ -106,7 +106,7 @@ define(function (require) {
var seriesMap = this._seriesMap;
var seriesModel = seriesMap[seriesName];
if (seriesModel) {
seriesModel.mergeOption(series);
seriesModel.mergeOption(series, this);
}
else {
seriesModel = SeriesModel.create(series, this, idx);
......
......@@ -38,13 +38,13 @@ define(function(require) {
* @type {module:echarts/data/List|module:echarts/data/Tree|module:echarts/data/Graph}
* @private
*/
this._data = this.getInitialData(seriesOption);
this._data = this.getInitialData(seriesOption, ecModel);
this._stack = [];
},
mergeOption: function (newSeriesOption) {
this._data = this.getInitialData(newSeriesOption);
mergeOption: function (newSeriesOption, ecModel) {
this._data = this.getInitialData(newSeriesOption, ecModel);
},
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册