You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by ov...@apache.org on 2019/02/14 09:11:11 UTC

[incubator-echarts] branch master updated: fix(polar): barWidth calculation when stack on multiple polars #9626

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 5bec750  fix(polar): barWidth calculation when stack on multiple polars #9626
5bec750 is described below

commit 5bec7507bda30993e08d4937d6b3c76dd4cc6d77
Author: Ovilia <zw...@gmail.com>
AuthorDate: Thu Feb 14 16:09:47 2019 +0800

    fix(polar): barWidth calculation when stack on multiple polars #9626
---
 src/layout/barPolar.js | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/layout/barPolar.js b/src/layout/barPolar.js
index c788e9a..a5536ee 100644
--- a/src/layout/barPolar.js
+++ b/src/layout/barPolar.js
@@ -26,8 +26,8 @@ function getSeriesStackId(seriesModel) {
         || '__ec_stack_' + seriesModel.seriesIndex;
 }
 
-function getAxisKey(axis) {
-    return axis.dim;
+function getAxisKey(polar, axis) {
+    return axis.dim + polar.model.componentIndex;
 }
 
 /**
@@ -60,10 +60,11 @@ function barLayoutPolar(seriesType, ecModel, api) {
         var data = seriesModel.getData();
         var polar = seriesModel.coordinateSystem;
         var baseAxis = polar.getBaseAxis();
+        var axisKey = getAxisKey(polar, baseAxis);
 
         var stackId = getSeriesStackId(seriesModel);
         var columnLayoutInfo
-            = barWidthAndOffset[getAxisKey(baseAxis)][stackId];
+            = barWidthAndOffset[axisKey][stackId];
         var columnOffset = columnLayoutInfo.offset;
         var columnWidth = columnLayoutInfo.width;
         var valueAxis = polar.getOtherAxis(baseAxis);
@@ -185,13 +186,14 @@ function calRadialBar(barSeries, api) {
         var polar = seriesModel.coordinateSystem;
 
         var baseAxis = polar.getBaseAxis();
+        var axisKey = getAxisKey(polar, baseAxis);
 
         var axisExtent = baseAxis.getExtent();
         var bandWidth = baseAxis.type === 'category'
             ? baseAxis.getBandWidth()
             : (Math.abs(axisExtent[1] - axisExtent[0]) / data.count());
 
-        var columnsOnAxis = columnsMap[getAxisKey(baseAxis)] || {
+        var columnsOnAxis = columnsMap[axisKey] || {
             bandWidth: bandWidth,
             remainedWidth: bandWidth,
             autoWidthCount: 0,
@@ -200,7 +202,7 @@ function calRadialBar(barSeries, api) {
             stacks: {}
         };
         var stacks = columnsOnAxis.stacks;
-        columnsMap[getAxisKey(baseAxis)] = columnsOnAxis;
+        columnsMap[axisKey] = columnsOnAxis;
 
         var stackId = getSeriesStackId(seriesModel);
 


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