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/05/17 10:06:21 UTC

[incubator-echarts] branch fix/fix-rotate-and-tooltip created (now 6e0cd1f)

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

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


      at 6e0cd1f  Avoid async error if chart is disposed and tooltip is displayed delayed .

This branch includes the following new commits:

     new bceb2df  Add test cases for pie label rotate.
     new 6e0cd1f  Avoid async error if chart is disposed and tooltip is displayed delayed .

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.



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


[incubator-echarts] 02/02: Avoid async error if chart is disposed and tooltip is displayed delayed .

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

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

commit 6e0cd1f4c8da13aa6636bb51741d4873d6db005d
Author: sushuang <su...@gmail.com>
AuthorDate: Fri May 17 18:04:57 2019 +0800

    Avoid async error if chart is disposed and tooltip is displayed delayed .
---
 src/component/tooltip/TooltipView.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/component/tooltip/TooltipView.js b/src/component/tooltip/TooltipView.js
index cd4e183..a745184 100644
--- a/src/component/tooltip/TooltipView.js
+++ b/src/component/tooltip/TooltipView.js
@@ -155,7 +155,7 @@ export default echarts.extendComponentView({
                 // Show tip next tick after other charts are rendered
                 // In case highlight action has wrong result
                 // FIXME
-                self.manuallyShowTip(tooltipModel, ecModel, api, {
+                !api.isDisposed() && self.manuallyShowTip(tooltipModel, ecModel, api, {
                     x: self._lastX,
                     y: self._lastY
                 });


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


[incubator-echarts] 01/02: Add test cases for pie label rotate.

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

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

commit bceb2dfbf912d1cca6779237fe8820e919f13ddd
Author: sushuang <su...@gmail.com>
AuthorDate: Fri May 17 18:03:46 2019 +0800

    Add test cases for pie label rotate.
---
 test/pie-label.html | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 85 insertions(+)

diff --git a/test/pie-label.html b/test/pie-label.html
index 8df2a00..aee7aa8 100644
--- a/test/pie-label.html
+++ b/test/pie-label.html
@@ -42,6 +42,7 @@ under the License.
         <div id="main0"></div>
         <div id="main1"></div>
         <div id="main2"></div>
+        <div id="main3"></div>
 
 
         <script>
@@ -227,5 +228,89 @@ under the License.
 
 
 
+
+        <script>
+
+            require([
+                'echarts'/*, 'map/js/china' */
+            ], function (echarts) {
+
+                var count = 5;
+
+                function makeData(sign) {
+                    var data = [];
+                    for (var i = 0; i < count; i++) {
+                        var value = Math.random() * 50 * sign;
+                        value = +value.toFixed(2);
+
+                        if (i >= 2
+                            && i <= count - 2
+                            && i % 10 !== 0
+                            // Test the case that the bottom label is normal to display.
+                            && Math.abs(i - Math.round(count / 2)) > 2
+                        ) {
+                            value = sign > 0
+                                ? value - Math.floor(value)
+                                : value - Math.ceil(value);
+                            value = +value.toFixed(2);
+                        }
+
+                        data.push({
+                            name: value,
+                            value: value
+                        });
+                    }
+                    return data;
+                }
+
+                var pos = ['25%', '75%'];
+
+                var option = {
+                    title: [{
+                        text: 'label.rotate: true, label should be in redical direction.',
+                        textAlign: 'center',
+                        left: pos[0]
+                    }, {
+                        text: 'label.rotate: 20',
+                        textAlign: 'center',
+                        left: pos[1]
+                    }],
+                    series: [{
+                        type: 'pie',
+                        center: [pos[0], '50%'],
+                        minShowLabelAngle: 10,
+                        label: {
+                            show: true,
+                            rotate: true
+                        },
+                        labelLine: {
+                            length2: 0
+                        },
+                        radius: '30%',
+                        data: makeData(1)
+                    }, {
+                        type: 'pie',
+                        center: [pos[1], '50%'],
+                        minShowLabelAngle: 2,
+                        label: {
+                            show: true,
+                            rotate: 20
+                        },
+                        radius: '30%',
+                        data: makeData(-1)
+                    }]
+                };
+
+                var chart = testHelper.create(echarts, 'main3', {
+                    title: [
+                        'label should be rotated'
+                    ],
+                    option: option
+                });
+            });
+
+        </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