Blogger Information
Blog 26
fans 1
comment 1
visits 35436
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
echarts 统计直线图
Bystander
Original
2166 people have browsed it
  1. 使用echarts 实例:

<script type="text/javascript">
    var date = "<?= $date?>";
    var new_students = "<?= $new_students?>";
    var total_students = "<?= $total_students?>";
    date = date.split(",");
    new_students = new_students.split(",");
    total_students = total_students.split(",");
    console.log(total_students[1]);


    var myChart = echarts.init(document.getElementById('main'));

    // 指定图表的配置项和数据
    var option = {
        title: {
            text: ''
        },
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data:['新增医生','医生总人数']
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        toolbox: {
            feature: {
                saveAsImage: {}
            }
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: [date[0],date[1],date[2],date[3],date[4],date[5],date[6],]
        },
        yAxis: {
            type: 'value'
        },
        series: [
            {
                name:'新增医生',
                type:'line',
                // stack: '总量',
                data:[new_students[0],new_students[1],new_students[2],new_students[3],new_students[4],new_students[5],new_students[6]]
            },
            {
                name:'医生总人数',
                type:'line',
                // stack: '总量',  如果不删除 则计算的是累计
                data:[total_students[0],total_students[1],total_students[2],total_students[3],total_students[4],total_students[5],total_students[6]]
            }
        ]
    };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
</script

stack  如果使用则是累计统计数,根据情况设置 ,如不需要则不添加

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post