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 2021/07/08 03:29:23 UTC

[echarts-examples] branch dev updated: doc: add example of polar bar labels

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

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


The following commit(s) were added to refs/heads/dev by this push:
     new 7476801  doc: add example of polar bar labels
7476801 is described below

commit 7476801d7edf043578196d8d541281fd239eb309
Author: Ovilia <zw...@gmail.com>
AuthorDate: Thu Jul 8 11:29:01 2021 +0800

    doc: add example of polar bar labels
---
 public/data/bar-polar-label-radial.js     | 30 ++++++++++++++++++++++++++++++
 public/data/bar-polar-label-tangential.js | 30 ++++++++++++++++++++++++++++++
 src/data/chart-list-data.js               | 28 ++++++++++++++++++++++++----
 3 files changed, 84 insertions(+), 4 deletions(-)

diff --git a/public/data/bar-polar-label-radial.js b/public/data/bar-polar-label-radial.js
new file mode 100644
index 0000000..f5c9054
--- /dev/null
+++ b/public/data/bar-polar-label-radial.js
@@ -0,0 +1,30 @@
+option = {
+    title: [{
+        text: 'Radial Polar Bar Label Position (middle)'
+    }],
+    polar: {
+        radius: [30, '80%']
+    },
+    radiusAxis: {
+        max: 4,
+        startAngle: 75
+    },
+    angleAxis: {
+        type: 'category',
+        data: ['a', 'b', 'c', 'd'],
+        startAngle: 75
+    },
+    tooltip: {},
+    series: {
+        type: 'bar',
+        data: [2, 1.2, 2.4, 3.6],
+        coordinateSystem: 'polar',
+        label: {
+            show: true,
+            position: 'middle', // or 'start', 'insideStart', 'end', 'insideEnd'
+            formatter: '{b}: {c}',
+        }
+    },
+    backgroundColor: '#fff',
+    animation: 0
+};
diff --git a/public/data/bar-polar-label-tangential.js b/public/data/bar-polar-label-tangential.js
new file mode 100644
index 0000000..db37d3b
--- /dev/null
+++ b/public/data/bar-polar-label-tangential.js
@@ -0,0 +1,30 @@
+option = {
+    title: [{
+        text: 'Radial Polar Bar Label Position (middle)'
+    }],
+    polar: {
+        radius: [30, '80%']
+    },
+    angleAxis: {
+        max: 4,
+        startAngle: 75
+    },
+    radiusAxis: {
+        type: 'category',
+        data: ['a', 'b', 'c', 'd'],
+        startAngle: 75
+    },
+    tooltip: {},
+    series: {
+        type: 'bar',
+        data: [2, 1.2, 2.4, 3.6],
+        coordinateSystem: 'polar',
+        label: {
+            show: true,
+            position: 'middle', // or 'start', 'insideStart', 'end', 'insideEnd'
+            formatter: '{b}: {c}',
+        }
+    },
+    backgroundColor: '#fff',
+    animation: 0
+};
diff --git a/src/data/chart-list-data.js b/src/data/chart-list-data.js
index 41b952d..d28eb22 100644
--- a/src/data/chart-list-data.js
+++ b/src/data/chart-list-data.js
@@ -1612,10 +1612,30 @@ export default [
     "category": [
       "bar"
     ],
+    "id": "bar-polar-label-tangential",
+    "tags": [],
+    "title": "Tangential Polar Bar Label Position",
+    "titleCN": "极坐标系切向柱状图的标签位置",
+    "difficulty": 7
+  },
+  {
+    "category": [
+      "bar"
+    ],
+    "id": "bar-polar-label-radial",
+    "tags": [],
+    "title": "Radial Polar Bar Label Position",
+    "titleCN": "极坐标系径向柱状图的标签位置",
+    "difficulty": 7
+  },
+  {
+    "category": [
+      "bar"
+    ],
     "id": "bar-polar-stack",
     "tags": [],
-    "title": "Stacked Bar Chart on Polar",
-    "titleCN": "极坐标系下的堆叠柱状图",
+    "title": "Stacked Tangential Polar Bar",
+    "titleCN": "极坐标系切向堆积柱状图",
     "difficulty": 7
   },
   {
@@ -1624,8 +1644,8 @@ export default [
     ],
     "id": "bar-polar-stack-radial",
     "tags": [],
-    "title": "Stacked Bar Chart on Polar(Radial)",
-    "titleCN": "极坐标系下的堆叠柱状图",
+    "title": "Stacked Radial Polar Bar",
+    "titleCN": "极坐标系径向堆积柱状图",
     "difficulty": 7
   },
   {

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