提交 1dfbd904 编写于 作者: L lang

timeline preprocessor

上级 fee3bd38
...@@ -120,7 +120,6 @@ define(function (require) { ...@@ -120,7 +120,6 @@ define(function (require) {
var labelPosOpt = timelineModel.get('label.normal.position'); var labelPosOpt = timelineModel.get('label.normal.position');
var orient = timelineModel.get('orient'); var orient = timelineModel.get('orient');
var viewRect = getViewRect(timelineModel, api); var viewRect = getViewRect(timelineModel, api);
// Auto label offset. // Auto label offset.
if (labelPosOpt == null || labelPosOpt === 'auto') { if (labelPosOpt == null || labelPosOpt === 'auto') {
labelPosOpt = orient === 'horizontal' labelPosOpt = orient === 'horizontal'
......
...@@ -46,9 +46,7 @@ define(function(require) { ...@@ -46,9 +46,7 @@ define(function(require) {
delete opt.controlPosition; delete opt.controlPosition;
} }
var data = opt.data || (opt.data = []); zrUtil.each(opt.data || [], function (dataItem) {
zrUtil.each(data, function (dataItem) {
if (zrUtil.isObject(dataItem) && !zrUtil.isArray(dataItem)) { if (zrUtil.isObject(dataItem) && !zrUtil.isArray(dataItem)) {
if (!has(dataItem, 'value') && has(dataItem, 'name')) { if (!has(dataItem, 'value') && has(dataItem, 'name')) {
// In ec2, using name as value. // In ec2, using name as value.
......
...@@ -261,11 +261,16 @@ define(function (require) { ...@@ -261,11 +261,16 @@ define(function (require) {
} }
// Preprocess. // Preprocess.
each([baseOption].concat(timelineOptions), function (option) { each([baseOption].concat(timelineOptions)
each(optionPreprocessorFuncs, function (preProcess) { .concat(zrUtil.map(mediaList, function (media) {
preProcess(option); return media.option;
}); })),
}); function (option) {
each(optionPreprocessorFuncs, function (preProcess) {
preProcess(option);
});
}
);
return { return {
baseOption: baseOption, baseOption: baseOption,
......
...@@ -6,7 +6,7 @@ define(function () { ...@@ -6,7 +6,7 @@ define(function () {
} }
return { return {
// 全图默认背景 // 全图默认背景
backgroundColor: 'rgba(0,0,0,0)', // backgroundColor: 'rgba(0,0,0,0)',
// https://dribbble.com/shots/1065960-Infographic-Pie-chart-visualization // https://dribbble.com/shots/1065960-Infographic-Pie-chart-visualization
// color: ['#5793f3', '#d14a61', '#fd9c35', '#675bba', '#fec42c', '#dd4444', '#d4df5a', '#cd4870'], // color: ['#5793f3', '#d14a61', '#fd9c35', '#675bba', '#fec42c', '#dd4444', '#d4df5a', '#cd4870'],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册