SOURCE

console 命令行工具 X clear

                    
>
console
 // 设置数据和参数
    let lineChartData = { 
        "labels": ["1月", "2月", "3月", "4月", "5月", "6月"], 
        //这边的thisId分别对应labels的id
        // thisIds : [100,200,300,400,500,600],
        "datasets": [
        {
            "label": "零售额",
            "data": [100, 200, 300, 250, 450, 280], 
            "fill": false, 
            "borderColor": "#f00",
            "pointBackgroundColor":"#fff",
            "pointBorderColor":"#f00",
            "pointBorderWidth":2.5,
            "pointRadius":7,
            "lineTension": 0.1 
        },
        {
            "label": "同比零售额",
            "data": [500, 500, 200, 150, 600, 280], 
            "fill": false, 
            "borderColor": "#0068b7",
            "pointBackgroundColor":"#fff",
            "pointBorderColor":"#0068b7",
            "pointBorderWidth":2.5,
            "pointRadius":7,
            "lineTension": 0.1 
        },
        {
            "label": "环比零售额",
            "data": [400, 200, 300, 250, 250, 580], 
            "fill": false, 
            "borderColor": "#8fc31f",
            "pointBackgroundColor":"#fff",
            "pointBorderColor":"#8fc31f",
            "pointBorderWidth":2.5,
            "pointRadius":7,
            "lineTension": 0.1 
        }
    ] 
    }

    new Chart(document.getElementById("myChart"), { "type": "line", "data": lineChartData,"options": {} });
<script src="https://cdn.bootcss.com/Chart.js/2.7.2/Chart.js"></script>
<canvas id="myChart" style="width:600px;height:400px"></canvas>