商量历史价格分析

描述:当前是关于Echarts图表中的 折线图 示例。
 
            const set1 = [
    ['日期', '挂牌价', '到手优惠', '到手价', '凑单优惠', '凑单价'],
    ['2019/2/10', 240, 7.73, 232.27, 13.96, 226.04],
    ['2019/2/11', 234, 10.92, 223.08, 13.62, 220.38],
    ['2019/2/12', 242, 7.8, 234.2, 9.51, 232.49],
    ['2019/2/13', 210, 44.58, 165.42, 74.4, 135.6],
    ['2019/2/14', 239, 34.31, 204.69, 57.59, 181.41],
    ['2019/2/15', 224, 23.48, 200.52, 32.53, 191.47],
    ['2019/2/16', 238, 47.37, 190.63, 54.03, 183.97],
    ['2019/2/17', 203, 45.79, 157.21, 49.68, 153.32],
    ['2019/2/18', 238, 9.65, 228.35, 14.71, 223.29],
    ['2019/2/19', 209, 14.9, 194.1, 21.04, 187.96],
    ['2019/2/20', 248, 6.18, 241.82, 9.46, 238.54],
    ['2019/2/21', 209, 47.02, 161.98, 61.21, 147.79],
    ['2019/2/22', 218, 14.97, 203.03, 29.9, 188.1],
    ['2019/2/23', 204, 6.3, 197.7, 12.26, 191.74],
    ['2019/2/24', 207, 47.37, 159.63, 54.03, 152.97],
    ['2019/2/25', 222, 16.89, 205.11, 21.08, 200.92],
    ['2019/2/26', 222, 10.66, 211.34, 11.34, 210.66],
    ['2019/2/27', 236, 6.61, 229.39, 8.91, 227.09],
    ['2019/2/28', 224, 48.41, 175.59, 66.77, 157.23],
    ['2019/3/1', 242, 9.18, 232.82, 16.54, 225.46],
    ['2019/3/2', 224, 12.41, 211.59, 21.7, 202.3],
    ['2019/3/3', 227, 14.32, 212.68, 22.69, 204.31],
    ['2019/3/4', 250, 20.46, 229.54, 23.49, 226.51],
    ['2019/3/5', 216, 13.57, 202.43, 20.44, 195.56],
    ['2019/3/6', 217, 45.73, 171.27, 86.73, 130.27],
    ['2019/3/7', 239, 15.87, 223.13, 24.55, 214.45],
    ['2019/3/8', 230, 27.1, 202.9, 47.31, 182.69],
    ['2019/3/9', 213, 39.33, 173.67, 49.58, 163.42],
    ['2019/3/10', 224, 11.91, 212.09, 19.16, 204.84],
    ['2019/3/11', 239, 24.26, 214.74, 30.69, 208.31],
    ['2019/3/12', 230, 31.43, 198.57, 58.65, 171.35]
];

option = {
    dataset: [{
        source: set1,
    }],
    // backgroundColor: '#fff',
    dataZoom: {
        type: 'slider',
        handleSize: '80%',
        height: 16,
        bottom: 8
    },
    legend: {
        left: 16,
        top: 8,
        data: set1[0].slice(1)
    },
    grid: {
        left: 48,
        right: 24,
        top: 48,
        bottom: 64
    },
    tooltip: {
        show: true
    },
    xAxis: {
        type: 'time'
    },
    yAxis: {
        type: 'value'
    },
    series: Array.from({
        length: 5
    }).map((key, idx) => ({
        name: set1[0][idx + 1],
        type: 'line',
        // step: true,
        encode: {
            x: 0,
            y: idx + 1
        },
        markPoint: {
            data: [{
                    name: '最高',
                    type: 'max',
                },
                {
                    name: '最低',
                    type: 'min'
                }
            ],
            symbol: 'circle',
            symbolSize: '16',
            itemStyle: {
                opacity: 0.5
            },
            label: {
                show: false
            }
        }
    }))


};
myChart.resize({
    width: 1112,
    height: 320
});