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/02/20 14:50:14 UTC

[incubator-echarts] branch fix-radar-axis created (now 5d93759)

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

shenyi pushed a change to branch fix-radar-axis
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git.


      at 5d93759  fix(radar): optimize ticks calculation when min/max is not defined.

This branch includes the following new commits:

     new 5d93759  fix(radar): optimize ticks calculation when min/max is not defined.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


[incubator-echarts] 01/01: fix(radar): optimize ticks calculation when min/max is not defined.

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5d93759072fc58f2e55f4bac147ec809a0106fda
Author: pissang <bm...@gmail.com>
AuthorDate: Thu Feb 20 22:49:58 2020 +0800

    fix(radar): optimize ticks calculation when min/max is not defined.
    
    Fix value may excced min caused by https://github.com/apache/incubator-echarts/pull/11841
---
 src/coord/radar/Radar.js | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/coord/radar/Radar.js b/src/coord/radar/Radar.js
index aebc896..818e036 100644
--- a/src/coord/radar/Radar.js
+++ b/src/coord/radar/Radar.js
@@ -195,6 +195,7 @@ Radar.prototype.update = function (ecModel, api) {
         var fixedMax = axisModel.getMax();
         var interval = scale.getInterval();
 
+
         if (fixedMin != null && fixedMax != null) {
             // User set min, max, divide to get new interval
             scale.setExtent(+fixedMin, +fixedMax);
@@ -230,13 +231,10 @@ Radar.prototype.update = function (ecModel, api) {
             if (nicedSplitNumber > splitNumber) {
                 interval = increaseInterval(interval);
             }
-            // PENDING
-            var center = Math.ceil((rawExtent[0] + rawExtent[1]) / 2 / interval) * interval;
-            var halfSplitNumber = Math.round(splitNumber / 2);
-            scale.setExtent(
-                numberUtil.round(center - halfSplitNumber * interval),
-                numberUtil.round(center + (splitNumber - halfSplitNumber) * interval)
-            );
+            // TODO
+            var max = Math.ceil(rawExtent[1] / interval) * interval;
+            var min = numberUtil.round(max - interval * splitNumber);
+            scale.setExtent(min, max);
             scale.setInterval(interval);
         }
     });


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