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

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

commit a59feb4466c69c4380df6d7b365f21a20836df9f
Author: 100pah <sushuang0...@gmail.com>
AuthorDate: Mon Dec 4 17:41:51 2023 +0800

    [test] Add test case for https://github.com/apache/echarts/issues/19093
---
 test/lib/testHelper.js                |   3 +
 test/manual-svg-color-bug-202311.html | 184 ++++++++++++++++++++++++++++++++++
 2 files changed, 187 insertions(+)

diff --git a/test/lib/testHelper.js b/test/lib/testHelper.js
index 6df2c44a6..c570529d3 100644
--- a/test/lib/testHelper.js
+++ b/test/lib/testHelper.js
@@ -76,6 +76,7 @@
      * @param {Array.<Object>|Object} [opt.buttons] {text: ..., onClick: ...}, 
or an array of them.
      * @param {boolean} [opt.recordCanvas] 'test/lib/canteen.js' is required.
      * @param {boolean} [opt.recordVideo]
+     * @param {string} [opt.renderer] 'canvas' or 'svg'
      */
     testHelper.create = function (echarts, domOrId, opt) {
         var dom = getDom(domOrId);
@@ -267,6 +268,7 @@
      * @param {number} opt.width
      * @param {number} opt.height
      * @param {boolean} opt.draggable
+     * @param {string} opt.renderer 'canvas' or 'svg'
      */
     testHelper.createChart = function (echarts, domOrId, option, opt) {
         if (typeof opt === 'number') {
@@ -287,6 +289,7 @@
             }
 
             var chart = echarts.init(dom, null, {
+                renderer: opt.renderer,
                 useCoarsePointer: opt.useCoarsePointer,
                 pointerSize: opt.pointerSize
             });
diff --git a/test/manual-svg-color-bug-202311.html 
b/test/manual-svg-color-bug-202311.html
new file mode 100644
index 000000000..15d95b4e4
--- /dev/null
+++ b/test/manual-svg-color-bug-202311.html
@@ -0,0 +1,184 @@
+<!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" />
+        <script src="lib/simpleRequire.js"></script>
+        <script src="lib/config.js"></script>
+        <script src="lib/jquery.min.js"></script>
+        <script src="lib/facePrint.js"></script>
+        <script src="lib/testHelper.js"></script>
+        <link rel="stylesheet" href="lib/reset.css" />
+    </head>
+    <body>
+        <style>
+        </style>
+
+        <h2>Test this case on Safari.</h2>
+        <div>For <a target="_blank" 
href="https://github.com/apache/echarts/issues/19093";>apache/echarts#19093</a></div>
+        <br>
+
+        <div id="main0"></div>
+        <div id="main1"></div>
+
+        <script>
+        require([
+            'echarts',
+        ], function (echarts) {
+
+            var option;
+
+            option = {
+                animation: false,
+                "xAxis": {
+                    "type": "category",
+                    "data": ["2018FY", "2019FY", "2020FY", "2021FY", "2022FY"],
+                    axisLabel: {show: false}
+                },
+                "yAxis": {
+                    "type": "value",
+                    axisLabel: {show: false}
+                },
+                "series": [
+                    {
+                        "type": "bar",
+                        "name": "总营收(万美元)",
+                        "data": [111, 222, 3333, 444, 555],
+                        "label": {
+                            "show": true,
+                            "position": "top"
+                        }
+                    }
+                ]
+            };;
+
+            var chart = testHelper.create(echarts, 'main0', {
+                title: [
+                    'hover the bar and then leave (in mobile, just touch the 
bar)',
+                    'The label color should not become white.'
+                ],
+                option: option,
+                renderer: 'svg',
+            });
+        });
+        </script>
+
+        <!-- <script 
src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js";></script> 
-->
+        <script>
+            require([
+                'echarts',
+            ], function (echarts) {
+
+                var option;
+                option = {
+                    title: {
+                        text: 'Funnel'
+                    },
+                    tooltip: {
+                        trigger: 'item',
+                        formatter: '{a} <br/>{b} : {c}%'
+                    },
+                    toolbox: {
+                        feature: {
+                            dataView: { readOnly: false },
+                            restore: {},
+                            saveAsImage: {}
+                        }
+                    },
+                    legend: {
+                        data: ['Show', 'Click', 'Visit', 'Inquiry', 'Order']
+                    },
+                    series: [
+                        {
+                            name: 'Expected',
+                            type: 'funnel',
+                            left: '10%',
+                            width: '80%',
+                            label: {
+                                formatter: '{b}Expected'
+                            },
+                            labelLine: {
+                                show: false
+                            },
+                            emphasis: {
+                            label: {
+                                position: 'inside',
+                                formatter: '{b}Expected: {c}%'
+                            }
+                            },
+                            data: [
+                                { value: 60, name: 'Visit' },
+                                { value: 40, name: 'Inquiry' },
+                                { value: 20, name: 'Order' },
+                                { value: 80, name: 'Click' },
+                                { value: 100, name: 'Show' }
+                            ]
+                        },
+                        {
+                            name: 'Actual',
+                            type: 'funnel',
+                            left: '10%',
+                            width: '80%',
+                            maxSize: '80%',
+                            label: {
+                                position: 'inside',
+                                formatter: '{c}%',
+                                color: '#fff'
+                            },
+                            itemStyle: {
+                                opacity: 0.5,
+                                borderColor: '#fff',
+                                borderWidth: 2
+                            },
+                            emphasis: {
+                                label: {
+                                    position: 'inside',
+                                    formatter: '{b}Actual: {c}%'
+                                }
+                            },
+                            data: [
+                                { value: 30, name: 'Visit' },
+                                { value: 10, name: 'Inquiry' },
+                                { value: 5, name: 'Order' },
+                                { value: 50, name: 'Click' },
+                                { value: 80, name: 'Show' }
+                            ],
+                            z: 100
+                        }
+                    ]
+                };
+
+                var chart = testHelper.create(echarts, 'main1', {
+                    title: [
+                        'hover the funnel and then leave (in mobile, just 
touch the bar)',
+                        'The label color should not become white.'
+                    ],
+                    option: option,
+                    renderer: 'svg',
+                });
+            });
+        </script>
+
+    </body>
+</html>
+


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

Reply via email to