当前位置:   article > 正文

echarts --折柱混合图_echarts折柱混合图

echarts折柱混合图

在这里插入图片描述

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>折柱混合</title>
    <style>
        .item_t_l {
            width: 50%;
            margin: 111px auto
        }

        .recommend-special {
            color: #036DE6;
            border-bottom: none;
        }
    </style>
</head>

<body>
    <div class="item_t_l">
        <div class="recommend-special">
            <div class="recommend-title-l">折柱混合图</div>
        </div>
        <div class="assess_bar" style="width: 100%; height: 310px;"></div>
    </div>
    <script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.1.0/echarts.common.min.js"></script>
    <script>
        // 折柱混合图
        assessbarFn();
        function assessbarFn() {
            var chartDom = document.querySelector('.assess_bar');
            var myChart = echarts.init(chartDom);
            var option;
            option = {
                color: ['#4E99FF', '#ECEF08', '#FF8A8A'],
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'cross',
                        crossStyle: {
                            color: '#999'
                        }
                    }
                },
                legend: {
                    data: ['得分值', '公司平均值', '行业基准线']
                },
                xAxis: [
                    {
                        type: 'category',
                        data: ['数据战略规划', '数据实施', '数据战略评估'],
                        axisPointer: {
                            type: 'shadow'
                        }
                    }
                ],
                yAxis: [
                    {
                        type: 'value'
                    },
                    {
                        type: 'value'
                    }
                ],
                series: [
                    {
                        name: '得分值',
                        type: 'bar',
                        data: [2.0, 4.9, 7.0]
                    },
                    {
                        name: '公司平均值',
                        type: 'bar',
                        data: [2.6, 5.9, 9.0]
                    },
                    {
                        name: '行业基准线',
                        type: 'line',
                        data: [2.0, 2.2, 3.3]
                    }
                ]
            };
            option && myChart.setOption(option);
        }

    </script>
</body>

</html>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小惠珠哦/article/detail/834717
推荐阅读
相关标签
  

闽ICP备14008679号