提交 21a145f7 编写于 作者: 1 100pah

[dataZoom] Fix #4090 :enable dataZoom on polar

上级 0de7f3cd
...@@ -236,11 +236,13 @@ define(function (require) { ...@@ -236,11 +236,13 @@ define(function (require) {
_updateController: function (seriesModel, api) { _updateController: function (seriesModel, api) {
var controller = this._controller; var controller = this._controller;
var group = this.group; var group = this.group;
controller.rectProvider = function () {
controller.setContainsPoint(function (x, y) {
var rect = group.getBoundingRect(); var rect = group.getBoundingRect();
rect.applyTransform(group.transform); rect.applyTransform(group.transform);
return rect; return rect.contain(x, y);
}; });
if (seriesModel.coordinateSystem.type !== 'view') { if (seriesModel.coordinateSystem.type !== 'view') {
controller.disable(); controller.disable();
return; return;
......
...@@ -375,9 +375,9 @@ ...@@ -375,9 +375,9 @@
} }
var rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight()); var rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight());
controller.rectProvider = function () { controller.setContainsPoint(function (x, y) {
return rect; return rect.contain(x, y);
}; });
}, },
/** /**
...@@ -762,7 +762,7 @@ ...@@ -762,7 +762,7 @@
var text = nodeModel.get('name'); var text = nodeModel.get('name');
if (thisLayout.isLeafRoot) { if (thisLayout.isLeafRoot) {
var iconChar = seriesModel.get('drillDownIcon', true); var iconChar = seriesModel.get('drillDownIcon', true);
text = iconChar ? iconChar + ' ' + text : test; text = iconChar ? iconChar + ' ' + text : text;
} }
setText( setText(
......
...@@ -30,7 +30,6 @@ define(function(require) { ...@@ -30,7 +30,6 @@ define(function(require) {
xAxisIndex: null, // Default the first horizontal category axis. xAxisIndex: null, // Default the first horizontal category axis.
yAxisIndex: null, // Default the first vertical category axis. yAxisIndex: null, // Default the first vertical category axis.
filterMode: 'filter', // Possible values: 'filter' or 'empty'. filterMode: 'filter', // Possible values: 'filter' or 'empty'.
// 'filter': data items which are out of window will be removed. // 'filter': data items which are out of window will be removed.
// This option is applicable when filtering outliers. // This option is applicable when filtering outliers.
......
...@@ -42,21 +42,30 @@ define(function (require) { ...@@ -42,21 +42,30 @@ define(function (require) {
if (axisModel) { if (axisModel) {
axisModels.push(axisModel); axisModels.push(axisModel);
var coordSysName; var coordSysName;
if (dimNames.axis === 'xAxis' || dimNames.axis === 'yAxis') { var axisName = dimNames.axis;
if (axisName === 'xAxis' || axisName === 'yAxis') {
coordSysName = 'grid'; coordSysName = 'grid';
} }
else { else if (axisName === 'angleAxis' || axisName === 'radiusAxis') {
// Polar
coordSysName = 'polar'; coordSysName = 'polar';
} }
var coordModel = ecModel.queryComponents({
mainType: coordSysName, var coordModel = coordSysName
index: axisModel.get(coordSysName + 'Index'), ? ecModel.queryComponents({
id: axisModel.get(coordSysName + 'Id') mainType: coordSysName,
})[0]; index: axisModel.get(coordSysName + 'Index'),
id: axisModel.get(coordSysName + 'Id')
})[0]
: null;
if (coordModel != null) { if (coordModel != null) {
save(coordModel, axisModel, coordSysName === 'grid' ? cartesians : polars, coordModel.componentIndex); save(
coordModel,
axisModel,
coordSysName === 'grid' ? cartesians : polars,
coordModel.componentIndex
);
} }
} }
}, this); }, this);
......
...@@ -11,7 +11,8 @@ define(function(require) { ...@@ -11,7 +11,8 @@ define(function(require) {
* @protected * @protected
*/ */
defaultOption: { defaultOption: {
zoomLock: false // Whether disable zoom but only pan. silent: false, // Whether disable this inside zoom.
zoomLock: false // Whether disable zoom but only pan.
} }
}); });
}); });
\ No newline at end of file
...@@ -36,30 +36,36 @@ define(function (require) { ...@@ -36,30 +36,36 @@ define(function (require) {
this._range = dataZoomModel.getPercentRange(); this._range = dataZoomModel.getPercentRange();
} }
var targetInfo = this.getTargetInfo();
// Reset controllers. // Reset controllers.
var coordInfoList = this.getTargetInfo().cartesians; zrUtil.each(['cartesians', 'polars'], function (coordSysName) {
var allCoordIds = zrUtil.map(coordInfoList, function (coordInfo) {
return roams.generateCoordId(coordInfo.model); var coordInfoList = targetInfo[coordSysName];
}); var allCoordIds = zrUtil.map(coordInfoList, function (coordInfo) {
return roams.generateCoordId(coordInfo.model);
zrUtil.each(coordInfoList, function (coordInfo) { });
var coordModel = coordInfo.model;
roams.register( zrUtil.each(coordInfoList, function (coordInfo) {
api, var coordModel = coordInfo.model;
{ var coordinateSystem = coordModel.coordinateSystem;
coordId: roams.generateCoordId(coordModel),
allCoordIds: allCoordIds, roams.register(
coordinateSystem: coordModel.coordinateSystem, api,
dataZoomId: dataZoomModel.id, {
throttleRate: dataZoomModel.get('throttle', true), coordId: roams.generateCoordId(coordModel),
panGetRange: bind(this._onPan, this, coordInfo), allCoordIds: allCoordIds,
zoomGetRange: bind(this._onZoom, this, coordInfo) coordinateSystem: coordinateSystem,
} containsPoint: bind(operations[coordSysName].containsPoint, this, coordinateSystem),
); dataZoomId: dataZoomModel.id,
}, this); throttleRate: dataZoomModel.get('throttle', true),
panGetRange: bind(this._onPan, this, coordInfo, coordSysName),
zoomGetRange: bind(this._onZoom, this, coordInfo, coordSysName)
}
);
}, this);
// TODO }, this);
// polar支持
}, },
/** /**
...@@ -74,100 +80,137 @@ define(function (require) { ...@@ -74,100 +80,137 @@ define(function (require) {
/** /**
* @private * @private
*/ */
_onPan: function (coordInfo, controller, dx, dy) { _onPan: function (coordInfo, coordSysName, controller, dx, dy, oldX, oldY, newX, newY) {
return ( if (this.dataZoomModel.option.silent) {
this._range = panCartesian(
[dx, dy], this._range, controller, coordInfo
)
);
},
/**
* @private
*/
_onZoom: function (coordInfo, controller, scale, mouseX, mouseY) {
var dataZoomModel = this.dataZoomModel;
if (dataZoomModel.option.zoomLock) {
return this._range; return this._range;
} }
return ( var range = this._range.slice();
this._range = scaleCartesian(
1 / scale, [mouseX, mouseY], this._range,
controller, coordInfo, dataZoomModel
)
);
}
}); // Calculate transform by the first axis.
var axisModel = coordInfo.axisModels[0];
if (!axisModel) {
return;
}
function panCartesian(pixelDeltas, range, controller, coordInfo) { var directionInfo = operations[coordSysName].getDirectionInfo(
range = range.slice(); [oldX, oldY], [newX, newY], axisModel, controller, coordInfo
);
// Calculate transform by the first axis. var percentDelta = directionInfo.signal
var axisModel = coordInfo.axisModels[0]; * (range[1] - range[0])
if (!axisModel) { * directionInfo.pixel / directionInfo.pixelLength;
return;
}
var directionInfo = getDirectionInfo(pixelDeltas, axisModel, controller); sliderMove(percentDelta, range, [0, 100], 'rigid');
var percentDelta = directionInfo.signal return (this._range = range);
* (range[1] - range[0]) },
* directionInfo.pixel / directionInfo.pixelLength;
sliderMove( /**
percentDelta, * @private
range, */
[0, 100], _onZoom: function (coordInfo, coordSysName, controller, scale, mouseX, mouseY) {
'rigid' var option = this.dataZoomModel.option;
);
return range; if (option.silent || option.zoomLock) {
} return this._range;
}
function scaleCartesian(scale, mousePoint, range, controller, coordInfo, dataZoomModel) { var range = this._range.slice();
range = range.slice();
// Calculate transform by the first axis. // Calculate transform by the first axis.
var axisModel = coordInfo.axisModels[0]; var axisModel = coordInfo.axisModels[0];
if (!axisModel) { if (!axisModel) {
return; return;
} }
var directionInfo = getDirectionInfo(mousePoint, axisModel, controller); var directionInfo = operations[coordSysName].getDirectionInfo(
null, [mouseX, mouseY], axisModel, controller, coordInfo
);
var mouse = directionInfo.pixel - directionInfo.pixelStart; var percentPoint = (directionInfo.pixel - directionInfo.pixelStart) /
var percentPoint = mouse / directionInfo.pixelLength * (range[1] - range[0]) + range[0]; directionInfo.pixelLength * (range[1] - range[0]) + range[0];
scale = Math.max(scale, 0); scale = Math.max(1 / scale, 0);
range[0] = (range[0] - percentPoint) * scale + percentPoint; range[0] = (range[0] - percentPoint) * scale + percentPoint;
range[1] = (range[1] - percentPoint) * scale + percentPoint; range[1] = (range[1] - percentPoint) * scale + percentPoint;
return (this._range = fixRange(range));
}
return fixRange(range); });
}
function getDirectionInfo(xy, axisModel, controller) { var operations = {
var axis = axisModel.axis;
var rect = controller.rectProvider(); cartesians: {
var ret = {};
getDirectionInfo: function (oldPoint, newPoint, axisModel, controller, coordInfo) {
var axis = axisModel.axis;
var ret = {};
var rect = coordInfo.model.coordinateSystem.getRect();
oldPoint = oldPoint || [0, 0];
if (axis.dim === 'x') {
ret.pixel = newPoint[0] - oldPoint[0];
ret.pixelLength = rect.width;
ret.pixelStart = rect.x;
ret.signal = axis.inverse ? 1 : -1;
}
else { // axis.dim === 'y'
ret.pixel = newPoint[1] - oldPoint[1];
ret.pixelLength = rect.height;
ret.pixelStart = rect.y;
ret.signal = axis.inverse ? -1 : 1;
}
return ret;
},
containsPoint: function (coordinateSystem, x, y) {
return coordinateSystem.getRect().contain(x, y);
}
},
if (axis.dim === 'x') { polars: {
ret.pixel = xy[0];
ret.pixelLength = rect.width; getDirectionInfo: function (oldPoint, newPoint, axisModel, controller, coordInfo) {
ret.pixelStart = rect.x; var axis = axisModel.axis;
ret.signal = axis.inverse ? 1 : -1; var ret = {};
} var polar = coordInfo.model.coordinateSystem;
else { // axis.dim === 'y' var radiusExtent = polar.getRadiusAxis().getExtent();
ret.pixel = xy[1]; var angleExtent = polar.getAngleAxis().getExtent();
ret.pixelLength = rect.height;
ret.pixelStart = rect.y; oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0];
ret.signal = axis.inverse ? -1 : 1; newPoint = polar.pointToCoord(newPoint);
if (axisModel.mainType === 'radiusAxis') {
ret.pixel = newPoint[0] - oldPoint[0];
// ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]);
// ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]);
ret.pixelLength = radiusExtent[1] - radiusExtent[0];
ret.pixelStart = radiusExtent[0];
ret.signal = axis.inverse ? 1 : -1;
}
else { // 'angleAxis'
ret.pixel = newPoint[1] - oldPoint[1];
// ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]);
// ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]);
ret.pixelLength = angleExtent[1] - angleExtent[0];
ret.pixelStart = angleExtent[0];
ret.signal = axis.inverse ? -1 : 1;
}
return ret;
},
containsPoint: function (coordinateSystem, x, y) {
var radius = coordinateSystem.getRadiusAxis().getExtent()[1];
var cx = coordinateSystem.cx;
var cy = coordinateSystem.cy;
return Math.pow(x - cx, 2) + Math.pow(y - cy, 2) <= Math.pow(radius, 2);
}
} }
};
return ret;
}
function fixRange(range) { function fixRange(range) {
// Clamp, using !(<= or >=) to handle NaN. // Clamp, using !(<= or >=) to handle NaN.
......
...@@ -23,7 +23,7 @@ define(function(require) { ...@@ -23,7 +23,7 @@ define(function(require) {
* @param {module:echarts/ExtensionAPI} api * @param {module:echarts/ExtensionAPI} api
* @param {Object} dataZoomInfo * @param {Object} dataZoomInfo
* @param {string} dataZoomInfo.coordId * @param {string} dataZoomInfo.coordId
* @param {Object} dataZoomInfo.coordinateSystem * @param {Function} dataZoomInfo.containsPoint
* @param {Array.<string>} dataZoomInfo.allCoordIds * @param {Array.<string>} dataZoomInfo.allCoordIds
* @param {string} dataZoomInfo.dataZoomId * @param {string} dataZoomInfo.dataZoomId
* @param {number} dataZoomInfo.throttleRate * @param {number} dataZoomInfo.throttleRate
...@@ -62,10 +62,7 @@ define(function(require) { ...@@ -62,10 +62,7 @@ define(function(require) {
} }
// Consider resize, area should be always updated. // Consider resize, area should be always updated.
var rect = dataZoomInfo.coordinateSystem.getRect().clone(); record.controller.setContainsPoint(dataZoomInfo.containsPoint);
record.controller.rectProvider = function () {
return rect;
};
// Update throttle. // Update throttle.
throttle.createOrUpdate( throttle.createOrUpdate(
...@@ -150,9 +147,9 @@ define(function(require) { ...@@ -150,9 +147,9 @@ define(function(require) {
}); });
} }
function onPan(record, dx, dy) { function onPan(record, dx, dy, oldX, oldY, newX, newY) {
wrapAndDispatch(record, function (info) { wrapAndDispatch(record, function (info) {
return info.panGetRange(record.controller, dx, dy); return info.panGetRange(record.controller, dx, dy, oldX, oldY, newX, newY);
}); });
} }
......
...@@ -285,9 +285,9 @@ define(function (require) { ...@@ -285,9 +285,9 @@ define(function (require) {
} }
}, this); }, this);
controller.rectProvider = function () { controller.setContainsPoint(function (x, y) {
return geo.getViewRectAfterRoam(); return geo.getViewRectAfterRoam().contain(x, y);
}; });
} }
}; };
......
...@@ -16,8 +16,8 @@ define(function (require) { ...@@ -16,8 +16,8 @@ define(function (require) {
var x = e.offsetX; var x = e.offsetX;
var y = e.offsetY; var y = e.offsetY;
var rect = this.rectProvider && this.rectProvider();
if (rect && rect.contain(x, y)) { if (this.containsPoint && this.containsPoint(x, y)) {
this._x = x; this._x = x;
this._y = y; this._y = y;
this._dragging = true; this._dragging = true;
...@@ -40,8 +40,11 @@ define(function (require) { ...@@ -40,8 +40,11 @@ define(function (require) {
var x = e.offsetX; var x = e.offsetX;
var y = e.offsetY; var y = e.offsetY;
var dx = x - this._x; var oldX = this._x;
var dy = y - this._y; var oldY = this._y;
var dx = x - oldX;
var dy = y - oldY;
this._x = x; this._x = x;
this._y = y; this._y = y;
...@@ -56,7 +59,7 @@ define(function (require) { ...@@ -56,7 +59,7 @@ define(function (require) {
} }
eventTool.stop(e.event); eventTool.stop(e.event);
this.trigger('pan', dx, dy); this.trigger('pan', dx, dy, oldX, oldY, x, y);
} }
} }
...@@ -81,9 +84,7 @@ define(function (require) { ...@@ -81,9 +84,7 @@ define(function (require) {
} }
function zoom(e, zoomDelta, zoomX, zoomY) { function zoom(e, zoomDelta, zoomX, zoomY) {
var rect = this.rectProvider && this.rectProvider(); if (this.containsPoint && this.containsPoint(zoomX, zoomY)) {
if (rect && rect.contain(zoomX, zoomY)) {
// When mouse is out of roamController rect, // When mouse is out of roamController rect,
// default befavoius should be be disabled, otherwise // default befavoius should be be disabled, otherwise
// page sliding is disabled, contrary to expectation. // page sliding is disabled, contrary to expectation.
...@@ -128,9 +129,8 @@ define(function (require) { ...@@ -128,9 +129,8 @@ define(function (require) {
* *
* @param {module:zrender/zrender~ZRender} zr * @param {module:zrender/zrender~ZRender} zr
* @param {module:zrender/Element} target * @param {module:zrender/Element} target
* @param {Function} [rectProvider]
*/ */
function RoamController(zr, target, rectProvider) { function RoamController(zr, target) {
/** /**
* @type {module:zrender/Element} * @type {module:zrender/Element}
...@@ -140,7 +140,7 @@ define(function (require) { ...@@ -140,7 +140,7 @@ define(function (require) {
/** /**
* @type {Function} * @type {Function}
*/ */
this.rectProvider = rectProvider; this.containsPoint;
/** /**
* { min: 1, max: 2 } * { min: 1, max: 2 }
...@@ -167,6 +167,15 @@ define(function (require) { ...@@ -167,6 +167,15 @@ define(function (require) {
Eventful.call(this); Eventful.call(this);
/**
* @param {Function} containsPoint
* input: x, y
* output: boolean
*/
this.setContainsPoint = function (containsPoint) {
this.containsPoint = containsPoint;
};
/** /**
* Notice: only enable needed types. For example, if 'zoom' * Notice: only enable needed types. For example, if 'zoom'
* is not needed, 'zoom' should not be enabled, otherwise * is not needed, 'zoom' should not be enabled, otherwise
......
define(function (require) {
return {
/**
* @public
* @return {Array.<number|string|Date>}
*/
getMin: function () {
var option = this.option;
return option.rangeStart != null ? option.rangeStart : option.min;
},
/**
* @public
* @return {Array.<number|string|Date>}
*/
getMax: function () {
var option = this.option;
return option.rangeEnd != null ? option.rangeEnd : option.max;
},
/**
* @public
* @return {boolean}
*/
getNeedCrossZero: function () {
var option = this.option;
return (option.rangeStart != null || option.rangeEnd != null)
? false : !option.scale;
},
/**
* @public
* @param {number} rangeStart
* @param {number} rangeEnd
*/
setRange: function (rangeStart, rangeEnd) {
this.option.rangeStart = rangeStart;
this.option.rangeEnd = rangeEnd;
},
/**
* @public
*/
resetRange: function () {
// rangeStart and rangeEnd is readonly.
this.option.rangeStart = this.option.rangeEnd = null;
}
};
});
\ No newline at end of file
...@@ -20,7 +20,7 @@ define(function(require) { ...@@ -20,7 +20,7 @@ define(function(require) {
*/ */
init: function () { init: function () {
AxisModel.superApply(this, 'init', arguments); AxisModel.superApply(this, 'init', arguments);
this._resetRange(); this.resetRange();
}, },
/** /**
...@@ -28,7 +28,7 @@ define(function(require) { ...@@ -28,7 +28,7 @@ define(function(require) {
*/ */
mergeOption: function () { mergeOption: function () {
AxisModel.superApply(this, 'mergeOption', arguments); AxisModel.superApply(this, 'mergeOption', arguments);
this._resetRange(); this.resetRange();
}, },
/** /**
...@@ -36,45 +36,7 @@ define(function(require) { ...@@ -36,45 +36,7 @@ define(function(require) {
*/ */
restoreData: function () { restoreData: function () {
AxisModel.superApply(this, 'restoreData', arguments); AxisModel.superApply(this, 'restoreData', arguments);
this._resetRange(); this.resetRange();
},
/**
* @public
* @param {number} rangeStart
* @param {number} rangeEnd
*/
setRange: function (rangeStart, rangeEnd) {
this.option.rangeStart = rangeStart;
this.option.rangeEnd = rangeEnd;
},
/**
* @public
* @return {Array.<number|string|Date>}
*/
getMin: function () {
var option = this.option;
return option.rangeStart != null ? option.rangeStart : option.min;
},
/**
* @public
* @return {Array.<number|string|Date>}
*/
getMax: function () {
var option = this.option;
return option.rangeEnd != null ? option.rangeEnd : option.max;
},
/**
* @public
* @return {boolean}
*/
getNeedCrossZero: function () {
var option = this.option;
return (option.rangeStart != null || option.rangeEnd != null)
? false : !option.scale;
}, },
/** /**
...@@ -86,14 +48,6 @@ define(function(require) { ...@@ -86,14 +48,6 @@ define(function(require) {
index: this.get('gridIndex'), index: this.get('gridIndex'),
id: this.get('gridId') id: this.get('gridId')
})[0]; })[0];
},
/**
* @private
*/
_resetRange: function () {
// rangeStart and rangeEnd is readonly.
this.option.rangeStart = this.option.rangeEnd = null;
} }
}); });
...@@ -104,6 +58,7 @@ define(function(require) { ...@@ -104,6 +58,7 @@ define(function(require) {
} }
zrUtil.merge(AxisModel.prototype, require('../axisModelCommonMixin')); zrUtil.merge(AxisModel.prototype, require('../axisModelCommonMixin'));
zrUtil.merge(AxisModel.prototype, require('../axisModelZoomMixin'));
var extraOption = { var extraOption = {
// gridIndex: 0, // gridIndex: 0,
......
...@@ -7,14 +7,18 @@ define(function(require) { ...@@ -7,14 +7,18 @@ define(function(require) {
var axisModelCreator = require('../axisModelCreator'); var axisModelCreator = require('../axisModelCreator');
var PolarAxisModel = ComponentModel.extend({ var PolarAxisModel = ComponentModel.extend({
type: 'polarAxis', type: 'polarAxis',
/** /**
* @type {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis} * @type {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis}
*/ */
axis: null axis: null
}); });
zrUtil.merge(PolarAxisModel.prototype, require('../axisModelCommonMixin')); zrUtil.merge(PolarAxisModel.prototype, require('../axisModelCommonMixin'));
zrUtil.merge(PolarAxisModel.prototype, require('../axisModelZoomMixin'));
var polarAxisDefaultExtendedOption = { var polarAxisDefaultExtendedOption = {
angle: { angle: {
......
...@@ -3,14 +3,26 @@ ...@@ -3,14 +3,26 @@
<meta charset="utf-8"> <meta charset="utf-8">
<script src="esl.js"></script> <script src="esl.js"></script>
<script src="config.js"></script> <script src="config.js"></script>
<script src="lib/jquery.min.js"></script>
</head> </head>
<body> <body>
<style> <style>
html, body, #main { html, body, #main {
padding: 0;
margin: 0;
width: 100%; width: 100%;
height: 100%; height: 600px;
}
.operations {
margin-top: 10px;
margin-bottom: 30px;
} }
</style> </style>
<div class="operations">
<input type="radio" name="inside" value="radius"/> inside zoom radius
<input type="radio" name="inside" value="angle" checked="checked"/> inside zoom angle
<input type="radio" name="inside" value="all"/> inside zoom all
</div>
<div id="main"></div> <div id="main"></div>
<script> <script>
...@@ -51,11 +63,13 @@ ...@@ -51,11 +63,13 @@
}, },
dataZoom: [ dataZoom: [
{ {
id: 'slider-v',
show: true, show: true,
orient: 'vertical', orient: 'vertical',
angleAxisIndex: [0] angleAxisIndex: [0]
}, },
{ {
id: 'slider-h',
show: true, show: true,
orient: 'horizontal', orient: 'horizontal',
radiusAxisIndex: [0] radiusAxisIndex: [0]
...@@ -89,8 +103,77 @@ ...@@ -89,8 +103,77 @@
data: data3 data: data3
}] }]
}); });
var radioOption = {
radius: {
dataZoom: [
{
silent: true,
id: 'inside-a',
type: 'inside',
angleAxisIndex: 0
},
{
silent: false,
id: 'inside-r',
type: 'inside',
radiusAxisIndex: 0
}
]
},
angle: {
dataZoom: [
{
silent: false,
id: 'inside-a',
type: 'inside',
angleAxisIndex: 0
},
{
silent: true,
id: 'inside-r',
type: 'inside',
radiusAxisIndex: 0
}
]
},
all: {
dataZoom: [
{
silent: false,
id: 'inside-a',
type: 'inside',
angleAxisIndex: [0]
},
{
silent: false,
id: 'inside-r',
type: 'inside',
radiusAxisIndex: [0]
}
]
}
};
initRadio();
chart.setOption(radioOption.angle);
function initRadio() {
$('.operations').on('click', function () {
$('.operations input').each(function (idx, el) {
if (el.checked) {
chart.setOption(radioOption[el.getAttribute('value')]);
}
});
});
}
}) })
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册