You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2022/03/24 03:30:48 UTC

[echarts] branch fix-radius-splitLine created (now 5b4ad88)

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

wangzx pushed a change to branch fix-radius-splitLine
in repository https://gitbox.apache.org/repos/asf/echarts.git.


      at 5b4ad88  fix(splitLine): fix chart throws errors when `radiusAxis.splitLine` is enabled.

This branch includes the following new commits:

     new 5b4ad88  fix(splitLine): fix chart throws errors when `radiusAxis.splitLine` is enabled.

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


[echarts] 01/01: fix(splitLine): fix chart throws errors when `radiusAxis.splitLine` is enabled.

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

wangzx pushed a commit to branch fix-radius-splitLine
in repository https://gitbox.apache.org/repos/asf/echarts.git

commit 5b4ad8859ba0510ccb569f3a8d262db059316fb1
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Thu Mar 24 11:27:00 2022 +0800

    fix(splitLine): fix chart throws errors when `radiusAxis.splitLine` is enabled.
---
 src/component/axis/RadiusAxisView.ts |  5 +--
 test/runTest/actions/__meta__.json   |  1 +
 test/runTest/actions/splitLine.json  |  1 +
 test/splitLine.html                  | 62 ++++++++++++++++++++++++++++++++++--
 4 files changed, 65 insertions(+), 4 deletions(-)

diff --git a/src/component/axis/RadiusAxisView.ts b/src/component/axis/RadiusAxisView.ts
index 2cc5e78..b09dd50 100644
--- a/src/component/axis/RadiusAxisView.ts
+++ b/src/component/axis/RadiusAxisView.ts
@@ -116,7 +116,8 @@ const axisElementBuilders: Record<typeof selfBuilderAttrs[number], AxisElementBu
                 shape: {
                     cx: polar.cx,
                     cy: polar.cy,
-                    r: ticksCoords[i].coord
+                    // ensure circle radius >= 0
+                    r: Math.max(ticksCoords[i].coord, 0)
                 }
             }));
         }
@@ -225,4 +226,4 @@ function layoutAxis(polar: Polar, radiusAxisModel: RadiusAxisModel, axisAngle: n
     };
 }
 
-export default RadiusAxisView;
\ No newline at end of file
+export default RadiusAxisView;
diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json
index 468dbfb..1aa7762 100644
--- a/test/runTest/actions/__meta__.json
+++ b/test/runTest/actions/__meta__.json
@@ -163,6 +163,7 @@
   "scatter-single-axis": 2,
   "scatterMatrix": 3,
   "setOption": 1,
+  "splitLine": 1,
   "stackBar-dataZoom": 7,
   "sunburst-book": 1,
   "sunburst-canvas": 1,
diff --git a/test/runTest/actions/splitLine.json b/test/runTest/actions/splitLine.json
new file mode 100644
index 0000000..106e397
--- /dev/null
+++ b/test/runTest/actions/splitLine.json
@@ -0,0 +1 @@
+[{"name":"Action 1","ops":[{"type":"mousedown","time":660,"x":50,"y":175},{"type":"mouseup","time":802,"x":50,"y":175},{"time":803,"delay":400,"type":"screenshot-auto"}],"scrollY":797.2000122070312,"scrollX":0,"timestamp":1648092272395}]
\ No newline at end of file
diff --git a/test/splitLine.html b/test/splitLine.html
index 5a2fe74..ea847a0 100755
--- a/test/splitLine.html
+++ b/test/splitLine.html
@@ -41,7 +41,7 @@ under the License.
 
         <div id="main0"></div>
         <div id="main1"></div>
-
+        <div id="main2"></div>
 
 
 
@@ -201,9 +201,67 @@ under the License.
 
         </script>
 
+        <script>
+            require(['echarts'], function (echarts) {
+                var option = {
+                    polar: {
+                        // radius: '68.23%'
+                        // radius: '9%'
+                    },
+                    angleAxis: {
+                        max: 4,
+                        startAngle: 75
+                    },
+                    radiusAxis: {
+                        type: 'category',
+                        data: ['a', 'b', 'c', 'd'],
+                        // root cause
+                        splitLine: {
+                            show: true,
+                            lineStyle: {
+                                color: 'blue',
+                                width: 1,
+                                type: 'dashed'
+                            }
+                        },
+                        splitArea: {
+                            show: true
+                        }
+                    },
+                    series: {
+                        type: 'bar',
+                        data: [2, 1.2, 2.4, 3.6],
+                        coordinateSystem: 'polar',
+                        label: {
+                            show: true,
+                            position: 'middle',
+                            formatter: '{b}: {c}'
+                        }
+                    }
+                };
 
+                var chart = testHelper.create(echarts, 'main2', {
+                    title: [
+                        'It shouldn\'t throw errors when **splitLine** is visible',
+                        'Shrink the page or click the **Resize** button to test'
+                    ],
+                    buttons: [
+                        {
+                            text: 'Resize',
+                            onclick: () => {
+                                chart.resize({
+                                    width: 382
+                                });
+                            }
+                        }
+                    ],
+                    option: option
+                });
+            });
+
+        </script>
 
 
 
     </body>
-</html>
\ No newline at end of file
+</html>

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