提交 4ad251e4 编写于 作者: O Ovilia

fix: sunburst roll-up piece update

#8132
上级 26d7c815
......@@ -23,6 +23,8 @@ function SunburstPiece(node, seriesModel, ecModel) {
var sector = new graphic.Sector({
z2: DEFAULT_SECTOR_Z
});
sector.seriesIndex = seriesModel.seriesIndex;
var text = new graphic.Text({
z2: DEFAULT_TEXT_Z,
silent: node.getModel('label').get('silent')
......@@ -65,6 +67,9 @@ SunburstPieceProto.updateData = function (
var itemModel = node.getModel();
var layout = node.getLayout();
if (!layout) {
console.log(node.getLayout());
}
var sectorShape = zrUtil.extend({}, layout);
sectorShape.label = null;
......
......@@ -43,7 +43,7 @@ var SunburstView = ChartView.extend({
payload.highlight.piece.onEmphasis(highlightPolicy);
}
else if (payload && payload.unhighlight) {
var piece = virtualRoot.piece;
var piece = this.virtualPiece;
if (!piece && virtualRoot.children.length) {
piece = virtualRoot.children[0].piece;
}
......@@ -129,19 +129,19 @@ var SunburstView = ChartView.extend({
function renderRollUp(virtualRoot, viewRoot) {
if (viewRoot.depth > 0) {
// Render
if (virtualRoot.piece) {
if (that.virtualPiece) {
// Update
virtualRoot.piece.updateData(
that.virtualPiece.updateData(
false, virtualRoot, 'normal', seriesModel, ecModel);
}
else {
// Add
virtualRoot.piece = new SunburstPiece(
that.virtualPiece = new SunburstPiece(
virtualRoot,
seriesModel,
ecModel
);
group.add(virtualRoot.piece);
group.add(that.virtualPiece);
}
if (viewRoot.piece._onclickEvent) {
......@@ -151,12 +151,12 @@ var SunburstView = ChartView.extend({
that._rootToNode(viewRoot.parentNode);
};
viewRoot.piece._onclickEvent = event;
virtualRoot.piece.on('click', event);
that.virtualPiece.on('click', event);
}
else if (virtualRoot.piece) {
else if (that.virtualPiece) {
// Remove
group.remove(virtualRoot.piece);
virtualRoot.piece = null;
group.remove(that.virtualPiece);
that.virtualPiece = null;
}
}
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册