默认选中 和 不选中 传送门?

设置单选 传送门?

echarts 设置默认选中,单选

<script>
    // 基于准备好的dom,初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));
    option = {

        legend: {
            selected:{ // 设置默认不显示
                'BTC':false,
                'SZCI':false,
                'SHCI':false
            },
            selectedMode:'single' // 设置单选多选模式
        },
        tooltip: {},
        dataset: {
            source:JSON.parse('<?php echo json_encode($charts)?>')
        },
        xAxis: {type: 'category',name:'万'},
        yAxis: {name:'人数'},
        series: [
            {type: 'bar'},
            {type: 'bar'},
            {type: 'bar'},
            {type: 'bar'}
        ]
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>

 

相关文章:

  • 2021-09-20
  • 2022-12-23
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-12
  • 2021-12-14
  • 2021-11-22
  • 2022-12-23
  • 2021-11-22
  • 2021-09-10
相关资源
相似解决方案