apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.59k stars 19.62k forks source link

Pie: cannot have label line color different of the fan color #8111

Closed lingtalfi closed 4 years ago

lingtalfi commented 6 years ago

Hi, I'm using echarts4, about pie: trying to set the label line color to black, but it always takes the color of the fan.

Here is my code:

            var myChart = echarts.init(document.getElementById('echarts-51e9bfb5cf8c602c74c30f1bc913eac9'));

            var option = {
                title: {
                    text: "Distribution des états de commande",
                    subtext: '',
                    x: 'left'
                },
                tooltip: {
                    trigger: 'item',
                    // formatter: "{a} <br/>{b} : {c} ({d}%)", // a is the series name
                    formatter: "{b} : {c} ({d}%)",
                },
                legend: {
                    orient: 'vertical',
                    right: 0,
                    data: ["En attente de paiement","En cours de pr\u00e9paration","Erreur de livraison","Paiement accept\u00e9"],
                },
                label: {
                    color: 'black',
                },
                labelLine: {
                    lineStyle: "black",
                    color: "black",
                },
                series: [
                    {
                        // name: 'coucou',
                        type: 'pie',
                        radius: '65%',
                        center: ['50%', '60%'],
                        data: [{"value":"7","name":"En attente de paiement"},{"value":"1","name":"En cours de pr\u00e9paration"},{"value":"1","name":"Erreur de livraison"},{"value":"5","name":"Paiement accept\u00e9"}],
                        itemStyle: {
                            emphasis: {
                                shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        },
                        labelLine: {
                            lineStyle: 'black'
                        }
                    }
                ]
            };

            myChart.setOption(option);
screen shot 2018-04-08 at 07 38 01

As you can see on the image above, the label of each fan is black (good), but the line between the label and the fan is always of the same color as the fan. How can I turn it to black ?

(I ask this because I normally have some colors generated from the database, but they aren't well readable, for instance I have some yellow which makes it hard to read, and so having all lines in black in this case would make the pie more readable).

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.