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

[incubator-echarts] branch release updated (e7dafa6 -> 756a7d1)

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

sushuang pushed a change to branch release
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git.


    from e7dafa6  test: add test visual case for bar-width.html
     new d6d62cf  fix: fix the tick does not align with splitArea and axisPointer. The bug is brought by the fix of <https://github.com/apache/incubator-echarts/commit/c34274a6e30ec6da933139f7c93952f424f02d6c#diff-55a4b65a0a0b6e78888cfaf9b42973f8L318>.
     new 756a7d1  fix: remove useless code.

The 2 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.


Summary of changes:
 src/coord/Axis.js       |  9 ++----
 test/axis-interval.html | 74 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 76 insertions(+), 7 deletions(-)


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


[incubator-echarts] 02/02: fix: remove useless code.

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

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

commit 756a7d133de0e18051c4cbae88af5c1a46c8ad24
Author: SHUANG SU <su...@gmail.com>
AuthorDate: Thu Nov 7 21:08:48 2019 +0800

    fix: remove useless code.
---
 src/coord/Axis.js | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/coord/Axis.js b/src/coord/Axis.js
index ef5adac..9a34a3e 100644
--- a/src/coord/Axis.js
+++ b/src/coord/Axis.js
@@ -312,11 +312,6 @@ function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {
 
         each(ticksCoords, function (ticksItem) {
             ticksItem.coord -= shift / 2;
-            var tickCategoryInterval = 0;
-            // Avoid split a single data item when odd interval.
-            if (tickCategoryInterval % 2 > 0) {
-                ticksItem.coord -= shift / ((tickCategoryInterval + 1) * 2);
-            }
         });
 
         var dataExtent = axis.scale.getExtent();


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


[incubator-echarts] 01/02: fix: fix the tick does not align with splitArea and axisPointer. The bug is brought by the fix of .

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

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

commit d6d62cffb3723d41568383b901202add1cfd2ef2
Author: SHUANG SU <su...@gmail.com>
AuthorDate: Thu Nov 7 18:26:06 2019 +0800

    fix: fix the tick does not align with splitArea and axisPointer. The bug is brought by the fix of <https://github.com/apache/incubator-echarts/commit/c34274a6e30ec6da933139f7c93952f424f02d6c#diff-55a4b65a0a0b6e78888cfaf9b42973f8L318>.
---
 src/coord/Axis.js       |  6 ++--
 test/axis-interval.html | 74 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+), 3 deletions(-)

diff --git a/src/coord/Axis.js b/src/coord/Axis.js
index 1af761a..ef5adac 100644
--- a/src/coord/Axis.js
+++ b/src/coord/Axis.js
@@ -199,7 +199,7 @@ Axis.prototype = {
         var alignWithLabel = tickModel.get('alignWithLabel');
 
         fixOnBandTicksCoords(
-            this, ticksCoords, result.tickCategoryInterval, alignWithLabel, opt.clamp
+            this, ticksCoords, alignWithLabel, opt.clamp
         );
 
         return ticksCoords;
@@ -292,7 +292,7 @@ function fixExtentWithBands(extent, nTick) {
 // splitLine/spliteArea should layout appropriately corresponding
 // to displayed labels. (So we should not use `getBandWidth` in this
 // case).
-function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWithLabel, clamp) {
+function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {
     var ticksLen = ticksCoords.length;
 
     if (!axis.onBand || alignWithLabel || !ticksLen) {
@@ -312,7 +312,7 @@ function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWith
 
         each(ticksCoords, function (ticksItem) {
             ticksItem.coord -= shift / 2;
-            tickCategoryInterval = tickCategoryInterval || 0;
+            var tickCategoryInterval = 0;
             // Avoid split a single data item when odd interval.
             if (tickCategoryInterval % 2 > 0) {
                 ticksItem.coord -= shift / ((tickCategoryInterval + 1) * 2);
diff --git a/test/axis-interval.html b/test/axis-interval.html
index eae7abc..f9c5664 100644
--- a/test/axis-interval.html
+++ b/test/axis-interval.html
@@ -68,6 +68,7 @@ under the License.
         <div class="chart" id="main4"></div>
     </div>
 
+    <div class="chart" id="main5"></div>
 
 
     <script>
@@ -462,6 +463,79 @@ under the License.
     </script>
 
 
+
+
+        <script>
+            require([
+                'echarts'
+            ], function (echarts) {
+
+                var xAxisData = [
+                    'Aries', 'Taurus', 'Gemini', 'Cancer', 'Leo', 'Virgo', 'Libra',
+                    'Scorpio', 'Sagittarius', 'Capricornus', 'Aquarius', 'Pisces'
+                ];
+                var data0 = [];
+                var data1 = [];
+                var data2 = [];
+                var data3 = [];
+
+                for (var i = 0; i < xAxisData.length; i++) {
+                    data0.push([Math.random() * 100, Math.random() * 30]);
+                    data1.push(Math.random() * 30);
+                    data2.push([Math.random() * (i % 2 === 0 ? 100 : 1000000), Math.random() * 30]);
+                    data3.push([+new Date() + Math.round(Math.random() * 3600 * 24 * 30), Math.random() * 30]);
+                }
+
+                var height = '18%';
+
+                var option = {
+                    tooltip: {
+                        trigger: 'axis'
+                    },
+                    dataZoom: [{
+                        type: 'inside'
+                    }, {
+                        type: 'slider'
+                    }],
+                    xAxis: [{
+                        type: 'category',
+                        data: xAxisData,
+                        height: height,
+                        axisTick: {
+                            // alignWithLabel: true
+                        },
+                        // splitLine: {show: true},
+                        axisPointer: {
+                            type: 'shadow'
+                        }
+                    }],
+                    yAxis: {
+                        // splitLine: {show: false}
+                    },
+                    series: [{
+                        type: 'scatter',
+                        symbolSize: function (val) {
+                            return val;
+                        },
+                        data: data1
+                    }]
+                };
+
+                var chart = testHelper.create(echarts, 'main5', {
+                    title: 'tick split should be correct',
+                    option: option,
+                    width: 800,
+                    height: 240
+                    // recordCanvas: true
+                });
+            });
+
+        </script>
+
+
+
+
+
 </body>
 
 </html>
\ No newline at end of file


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