echarts line chart not stacking settings

An important parameter stack for line chart stacking. As long as the value of stack is set to be different, it will not stack. The example is as follows, the red part is the one that needs to be modified:

option = {
    title: {
        text: 'Line Chart Stacked'
    },
    tooltip: {
        trigger: 'axis'
    },
    legend: {
        data:['Email Marketing','Affiliate Ads','Video Ads','Direct Access' ,'Search Engine']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: false
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday', 'Sunday']
    },
    yAxis: {
        type: 'value'
    },
    series: [
        {
            name:'email marketing',
            type:'line',
            stack: 'total 1',
            data:[120, 132, 101, 134, 90, 230, 210]
        },
        {
            name:' Affiliate Ads',
            type:'line',
            stack: 'Total 2',
            data:[220, 182, 191, 234, 290, 330, 310]
        }
    ]
};


This way the line chart won't stack, try it now

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326375140&siteId=291194637