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/29 16:30:28 UTC

[incubator-echarts] branch fix/revert-label-color-function created (now 5a0aa9a)

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

sushuang pushed a change to branch fix/revert-label-color-function
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git.


      at 5a0aa9a  Revert #10487 . See the comments on the PR. We should think this through.

This branch includes the following new commits:

     new 5a0aa9a  Revert #10487 . See the comments on the PR. We should think this through.

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: Revert #10487 . See the comments on the PR. We should think this through.

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

sushuang pushed a commit to branch fix/revert-label-color-function
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git

commit 5a0aa9a1a75c87ab244829391f74775fc695f1f6
Author: sushuang <su...@gmail.com>
AuthorDate: Thu May 30 00:29:58 2019 +0800

    Revert #10487 . See the comments on the PR. We should think this through.
---
 src/util/graphic.js           |   4 -
 test/scatter-label-color.html | 184 ------------------------------------------
 2 files changed, 188 deletions(-)

diff --git a/src/util/graphic.js b/src/util/graphic.js
index c17192a..b8c2373 100644
--- a/src/util/graphic.js
+++ b/src/util/graphic.js
@@ -653,10 +653,6 @@ export function setLabelStyle(
         setTextStyle(emphasisStyle, emphasisModel, emphasisSpecified, opt, true);
     }
 
-    if (typeof normalModel.get('color') === 'function') {
-        normalStyle.textFill = normalModel.get('color')(labelDataIndex);
-    }
-
     normalStyle.text = normalStyleText;
     emphasisStyle.text = emphasisStyleText;
 }
diff --git a/test/scatter-label-color.html b/test/scatter-label-color.html
deleted file mode 100644
index d251055..0000000
--- a/test/scatter-label-color.html
+++ /dev/null
@@ -1,184 +0,0 @@
-<!doctype html>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-
-<html>
-
-<head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
-    <script src="lib/testHelper.js"></script>
-    <script src="../dist/echarts.js"></script>
-</head>
-
-<body>
-    <style>
-        html,
-        body {
-            background: #111;
-            width: 100%;
-            height: 100%;
-            margin: 0;
-        }
-    </style>
-    <div id="main0"></div>
-    <div id="main1"></div>
-    <div id="main2"></div>
-    <script>
-        require(['echarts'], function (echarts) {
-            var option = {
-                xAxis: {},
-                yAxis: {},
-                series: [{
-                    symbolSize: 20,
-                    data: [
-                        [10.0, 8.04],
-                        [8.0, 6.95],
-                        [13.0, 7.58],
-                        [9.0, 8.81],
-                        [11.0, 8.33],
-                        [14.0, 9.96],
-                        [6.0, 7.24],
-                        [4.0, 4.26],
-                        [12.0, 10.84],
-                        [7.0, 4.82],
-                        [5.0, 5.68]
-                    ],
-                    type: 'scatter',
-                    label: {
-                        show: true,
-                        position: 'top',
-                        formatter(params) {
-                            return params.value[1];
-                        },
-                        color: function (index) {
-                            return index === 0 ?
-                                'black' :
-                                index === 1 ?
-                                'red' :
-                                index === 2 ?
-                                'yellow' :
-                                index === 3 ?
-                                'green' :
-                                index === 4 ?
-                                'orange' :
-                                index === 5 ?
-                                'pink' :
-                                index === 6 ?
-                                'red' :
-                                'gray'
-                        }
-                    }
-                }]
-            };
-    
-            var chart = testHelper.create(echarts, 'main0', {
-                    title: [
-                        'Label color should set as user designated'
-                    ],
-                    option: option
-            });
-        });
-
-    </script>
-    <script>
-        require(['echarts'], function (echarts) {
-            var option = {
-                xAxis: {},
-                yAxis: {},
-                series: [{
-                    symbolSize: 20,
-                    data: [
-                        [10.0, 8.04],
-                        [8.0, 6.95],
-                        [13.0, 7.58],
-                        [9.0, 8.81],
-                        [11.0, 8.33],
-                        [14.0, 9.96],
-                        [6.0, 7.24],
-                        [4.0, 4.26],
-                        [12.0, 10.84],
-                        [7.0, 4.82],
-                        [5.0, 5.68]
-                    ],
-                    type: 'scatter',
-                    label: {
-                        show: true,
-                        position: 'top',
-                        formatter(params) {
-                            return params.value[1];
-                        },
-                        color: 'black'
-                    }
-                }]
-            };
-    
-            var chart = testHelper.create(echarts, 'main1', {
-                    title: [
-                        'Label color should be black'
-                    ],
-                    option: option
-            });
-        });
-
-    </script>
-    <script>
-        require(['echarts'], function (echarts) {
-            var option = {
-                xAxis: {},
-                yAxis: {},
-                series: [{
-                    symbolSize: 20,
-                    data: [
-                        [10.0, 8.04],
-                        [8.0, 6.95],
-                        [13.0, 7.58],
-                        [9.0, 8.81],
-                        [11.0, 8.33],
-                        [14.0, 9.96],
-                        [6.0, 7.24],
-                        [4.0, 4.26],
-                        [12.0, 10.84],
-                        [7.0, 4.82],
-                        [5.0, 5.68]
-                    ],
-                    type: 'scatter',
-                    label: {
-                        show: true,
-                        position: 'top',
-                        formatter(params) {
-                            return params.value[1];
-                        }
-                    }
-                }]
-            };
-    
-            var chart = testHelper.create(echarts, 'main2', {
-                    title: [
-                        'Label color should be same as point color'
-                    ],
-                    option: option
-            });
-        });
-
-    </script>
-</body>
-
-</html>


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