提交 cdc3594a 编写于 作者: O Ovilia

fix(sunburst): label emphasis style inherits normal

上级 0d3906f7
......@@ -71,20 +71,14 @@ SunburstPieceProto.updateData = function (
var visualColor = getNodeColor(node, seriesModel, ecModel);
var normalStyle = itemModel.getModel('itemStyle').getItemStyle();
var normalLabelStyle = itemModel.getModel('label').getItemStyle();
var style;
var labelStyle;
if (state === 'normal') {
style = normalStyle;
labelStyle = normalLabelStyle;
}
else {
var stateStyle = itemModel.getModel(state + '.itemStyle')
.getItemStyle();
style = zrUtil.merge(stateStyle, normalStyle);
var stateLabelStyle = itemModel.getModel(state + '.label');
labelStyle = zrUtil.merge(stateLabelStyle, normalLabelStyle);
}
style = zrUtil.defaults(
{
......@@ -126,12 +120,6 @@ SunburstPieceProto.updateData = function (
}, seriesModel);
}
if (state === 'normal') {
sector.hoverStyle = itemModel.getModel('emphasis.itemStyle')
.getItemStyle();
graphic.setHoverStyle(this);
}
this._updateLabel(seriesModel, visualColor, state);
var cursorStyle = itemModel.getShallow('cursor');
......@@ -182,7 +170,7 @@ SunburstPieceProto.onDownplay = function () {
SunburstPieceProto._updateLabel = function (seriesModel, visualColor, state) {
var itemModel = this.node.getModel();
var normalModel = itemModel.getModel('label');
var labelModel = state === 'normal'
var labelModel = state === 'normal' || state === 'emphasis'
? normalModel
: itemModel.getModel(state + '.label');
var labelHoverModel = itemModel.getModel('emphasis.label');
......@@ -200,7 +188,7 @@ SunburstPieceProto._updateLabel = function (seriesModel, visualColor, state) {
var label = this.childAt(1);
graphic.setLabelStyle(
label.style, label.hoverStyle || {}, labelModel, labelHoverModel,
label.style, label.hoverStyle || {}, normalModel, labelHoverModel,
{
defaultText: labelModel.getShallow('show') ? text : null,
autoColor: visualColor,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册