You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2020/05/18 05:42:05 UTC

[incubator-echarts] branch label-enhancement updated: fix: fix rotation origin in graph and tree. fix itemStyle in and level of sunbrst.

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch label-enhancement
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git


The following commit(s) were added to refs/heads/label-enhancement by this push:
     new c94b745  fix: fix rotation origin in graph and tree. fix itemStyle in and level of sunbrst.
c94b745 is described below

commit c94b74512cec5c7c3b424ad3ee10d85334ffbebe
Author: pissang <bm...@gmail.com>
AuthorDate: Mon May 18 13:41:45 2020 +0800

    fix: fix rotation origin in graph and tree. fix itemStyle in and level of sunbrst.
---
 src/chart/graph/GraphView.ts         | 4 ++--
 src/chart/sunburst.ts                | 2 ++
 src/chart/sunburst/sunburstVisual.ts | 4 +---
 src/chart/tree/TreeView.ts           | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/chart/graph/GraphView.ts b/src/chart/graph/GraphView.ts
index 8f83896..e9e2559 100644
--- a/src/chart/graph/GraphView.ts
+++ b/src/chart/graph/GraphView.ts
@@ -272,8 +272,8 @@ class GraphView extends ChartView {
 
                 symbolPath.setTextConfig({
                     rotation: -rad,
-                    position: textPosition
-                    // textOrigin: 'center'
+                    position: textPosition,
+                    origin: 'center'
                 });
                 const emphasisState = symbolPath.ensureState('emphasis');
                 zrUtil.extend(emphasisState.textConfig || (emphasisState.textConfig = {}), {
diff --git a/src/chart/sunburst.ts b/src/chart/sunburst.ts
index 8922feb..3d47543 100644
--- a/src/chart/sunburst.ts
+++ b/src/chart/sunburst.ts
@@ -25,7 +25,9 @@ import './sunburst/SunburstView';
 import './sunburst/sunburstAction';
 
 import sunburstLayout from './sunburst/sunburstLayout';
+import sunburstVisual from './sunburst/sunburstVisual';
 import dataFilter from '../processor/dataFilter';
 
 echarts.registerLayout(zrUtil.curry(sunburstLayout, 'sunburst'));
 echarts.registerProcessor(zrUtil.curry(dataFilter, 'sunburst'));
+echarts.registerVisual(sunburstVisual);
\ No newline at end of file
diff --git a/src/chart/sunburst/sunburstVisual.ts b/src/chart/sunburst/sunburstVisual.ts
index 97eb785..bd3dc42 100644
--- a/src/chart/sunburst/sunburstVisual.ts
+++ b/src/chart/sunburst/sunburstVisual.ts
@@ -22,13 +22,11 @@ import SunburstSeriesModel, { SunburstSeriesNodeItemOption } from './SunburstSer
 import { extend } from 'zrender/src/core/util';
 
 export default function (ecModel: GlobalModel) {
-
-    ecModel.eachSeriesByType('graph', function (seriesModel: SunburstSeriesModel) {
+    ecModel.eachSeriesByType('sunburst', function (seriesModel: SunburstSeriesModel) {
         const data = seriesModel.getData();
         const tree = data.tree;
         tree.eachNode(function (node) {
             const model = node.getModel<SunburstSeriesNodeItemOption>();
-            // TODO Optimize
             const style = model.getModel('itemStyle').getItemStyle();
             const existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');
             extend(existsStyle, style);
diff --git a/src/chart/tree/TreeView.ts b/src/chart/tree/TreeView.ts
index 5ec59ad..dc01b8b 100644
--- a/src/chart/tree/TreeView.ts
+++ b/src/chart/tree/TreeView.ts
@@ -518,8 +518,8 @@ function updateNode(
         if (textContent) {
             symbolPath.setTextConfig({
                 position: seriesScope.labelModel.get('position') || textPosition,
-                rotation: rotate == null ? -rad : labelRotateRadian
-                // textOrigin: 'center',
+                rotation: rotate == null ? -rad : labelRotateRadian,
+                origin: 'center'
             });
             textContent.setStyle('verticalAlign', 'middle');
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org