鍍金池/ 問答/數(shù)據(jù)庫  HTML/ echarts共x軸的兩條曲線怎么做到首尾想接

echarts共x軸的兩條曲線怎么做到首尾想接

圖片描述

現(xiàn)在遇到一個問題,后臺返回一條data和一條date數(shù)據(jù),date作為橫坐標,現(xiàn)在需要將data數(shù)據(jù)分為兩條,后臺有返回一個時間分割點,現(xiàn)在數(shù)據(jù)切分已完成了,生成了兩條數(shù)據(jù),下面是我的series寫法:
series: [{

        name: '樣本內',
        type: 'line',
        smooth: true,
        itemStyle: {
            normal: {
                color: 'rgb(164, 215, 220)'
            }
        },
        areaStyle: {
            normal: {
                color: 'rgb(164, 215, 220)'
            }
        },
        data: data1,
    },{
        name: '樣本外',
        type: 'line',
        smooth: true,
        itemStyle: {
            normal: {
                color: '#000'
            }
        },
        areaStyle: {
            normal: {
                color: 'rgb(164, 215, 220)'
            }
        },
        data: data2,
    }],

他們共x軸,也就是:xAxis: {

        show: true,
        type: 'category',
        boundaryGap: false,
        data: date,
    },

問題來了,繪出來的曲線是上圖那樣的,現(xiàn)在想把他們首位相接,因為這兩條曲線來自同一個data而data又是于date相對應的,只是為了區(qū)分數(shù)據(jù)為樣本內外,這個怎么實現(xiàn)???大神救命!

回答
編輯回答
局外人

之前做過少數(shù)據(jù),不知道是不是你要的。參考 https://blog.csdn.net/qq_2564...

2017年3月13日 03:43
編輯回答
涼汐

沒看懂你在說啥,把效果圖截一下呢?

2018年1月5日 09:34