echarts example

by Vikash Kumar Gupta

HTML

<script src="https://cdn.bootcss.com/echarts/4.1.0/echarts.min.js"></script>
<div id="main" style="width: 600px;height:400px;"></div>

JavaScript

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

        var option = {
    title: {
        text: 'Test Tooltip with only intersecting points'
    },
    tooltip: {
        trigger: 'axis'
    },
    legend: {
        data: ['abc', 'def', 'ghi', 'jkl', 'mno']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: ['A', 'B', 'C', 'D', 'E', 'F']
    },
    yAxis: {
        type: 'value'
    },
    series: [
        {
            name: 'abc',
            type: 'line',
            data: [120, 132, 101, 134, 90, 230, 210]
        },
        {
            name: 'def',
            type: 'line',
            data: [220, 132, 191, 234, 290, 330, 310]
        },
        {
            name: 'ghi',
            type: 'line',
            data: [150, 132, 201, 154, 190, 330, 410]
        },
        {
            name: 'jkl',
            type: 'line',
            data: [320, 332, 301, 334, 390, 330, 320]
        },
        {
            name: 'mno',
            type: 'line',
            data: [820, 932, 901, 934, 1290, 1330, 1320]
        }
    ]
};

        myChart.setOption(option);