【问题标题】:Echarts 3.6.2 Legend Type "scroll" does not be applied correctlyEcharts 3.6.2 图例类型“滚动”未正确应用
【发布时间】:2021-05-20 08:46:26
【问题描述】:

在我的 angularJs 项目中,我有一个饼图 Echarts,我将其定义如下。问题是我可能有很多图例,我看到我可以使用 type:'scroll'here 制作它,但我失败了并且没有影响。

$scope.pieEcharts1 = {
                option: {
                    title: {
                        text: 'MyPieChart',
                        left: 'left',
                    },
                    tooltip: {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    legend: {
                        orient: 'vertical',
                        left: 'right',
                        type:'scroll',//does not work
                        data: []
                    },
                    label: {
                        normal: {
                            show: true,
                            formatter: '{d}%'
                        }
                    },
                    labelLine: {
                        normal: {
                            show: true
                        }
                    },
                    series: [{
                        name: 'MyData',
                        type: 'pie',
                        radius: '62%',
                        center: ['50%', '50%'],
                        data: [],
                        itemStyle: {
                            emphasis: {
                                shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        }
                    }]
                }
            }
        }
//http request to get data
$scope.pieEcharts1.option.legend.data = nameArray
$scope.pieEcharts1.option.series[0] = dataArray

我的代码有什么问题?

【问题讨论】:

    标签: angularjs pie-chart echarts


    【解决方案1】:

    从 v3.7.0 开始支持可滚动的legned。

    https://echarts.apache.org/zh/changelog.html#v3-7-0

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-06
      相关资源
      最近更新 更多