Skip to content

Commit

Permalink
support no coordinate system.
Browse files Browse the repository at this point in the history
  • Loading branch information
100pah committed Jun 30, 2017
1 parent c3422d0 commit a53bbc3
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/chart/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ define(function (require) {
dependencies: ['grid', 'polar', 'geo', 'singleAxis', 'calendar'],

defaultOption: {
coordinateSystem: 'cartesian2d',
coordinateSystem: 'cartesian2d', // Can be set as 'none'
zlevel: 0,
z: 2,
legendHoverLink: true
Expand Down Expand Up @@ -222,18 +222,21 @@ define(function (require) {
function makeRenderItem(customSeries, data, ecModel, api) {
var renderItem = customSeries.get('renderItem');
var coordSys = customSeries.coordinateSystem;
var prepareResult = {};

if (__DEV__) {
zrUtil.assert(renderItem, 'series.render is required.');
zrUtil.assert(
coordSys.prepareCustoms || prepareCustoms[coordSys.type],
'This coordSys does not support custom series.'
);
}
if (coordSys) {
if (__DEV__) {
zrUtil.assert(renderItem, 'series.render is required.');
zrUtil.assert(
coordSys.prepareCustoms || prepareCustoms[coordSys.type],
'This coordSys does not support custom series.'
);
}

var prepareResult = coordSys.prepareCustoms
? coordSys.prepareCustoms()
: prepareCustoms[coordSys.type](coordSys);
prepareResult = coordSys.prepareCustoms
? coordSys.prepareCustoms()
: prepareCustoms[coordSys.type](coordSys);
}

var userAPI = zrUtil.defaults({
getWidth: api.getWidth,
Expand All @@ -247,7 +250,7 @@ define(function (require) {
barLayout: barLayout,
currentSeriesIndices: currentSeriesIndices,
font: font
}, prepareResult.api);
}, prepareResult.api || {});

var userParams = {
context: {},
Expand Down

0 comments on commit a53bbc3

Please sign in to comment.