echarts曲線圖


drawLeftLine(){
        let drawLine = echarts.init(document.getElementById('data-left-middle-table-wrap'));
        let option = null;
        option = {
          tooltip: {
              trigger: 'axis'
          },
          color:['#52F478','#FFCD8B'],
          icon: "circle",
          legend: {
              x:'200px',
              y:'10px',
              data:['進車輛','出車輛'],
              textStyle:{
                fontSize: 14,//字體大小
                color: '#BBF6FF'//字體顏色
              },

          },
          grid: {
              left: '0px',
              // right: '0px',
              bottom: '0px',
              containLabel: true
          },
          xAxis: {
              type: 'category',
              name:'小時',
              nameGap:'15',
              show:true,
              boundaryGap:false,
              axisLabel:{
                textStyle:{
                  color:'#FFFFFF'
                }
              },
              splitArea : {
                show : false,
              },
              splitLine : {
                show :false,
              },
              axisLine:{
                lineStyle:{
                    color:'#BBF6FF',
                    width:2,
                },
                symbol:['none','arrow']
              },
              data: [0,2,4,6,8,10,12,14,16,18,20,22,24]
          },
          yAxis: {
              type: 'value',
              name:'數量',
              show:true,
              axisLabel:{
                textStyle:{
                  color:'#FFFFFF'
                }
              },
              splitArea : {
                show : false,
              },
              splitLine : {
                show :false,
              },
              axisLine:{
                lineStyle:{
                    color:'#BBF6FF',
                    width:2,
                },
                symbol:['none','arrow']
              },
          },
          series: [
              {
                  name:'進車輛',
                  type: 'line',
                  smooth: true,
                  lineStyle:{
                    normal:{
                      color:'#4EEE79',
                      width:3
                    }
                  },
                  areaStyle: {
                        normal: {
                            color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
                                offset: 0,
                                color: 'red'
                            }, {
                                offset: 1,
                                color: 'yellow'
                            }]),
                        },
                    },
                  data:[4,10, 40, 60, 100, 120,140,150,130,100,60,30,20]
              },
              {
                  name:'出車輛',
                  type:'line',
                  smooth: true,
                  lineStyle:{
                    normal:{
                      color:'#FFCD8B',
                      width:3
                    }
                  },
                  areaStyle: {
                        normal: {
                            color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
                                offset: 0,
                                color: '#4B4558'
                            }, {
                                offset: 1,
                                color: '#516359'
                            }]),
                        },
                    },
                  data:[3,8, 30, 50, 110, 100,80,100,120,90,60,20,10]
              }
          ]
      };
      if (option && typeof option === "object") {
          drawLine.setOption(option);
      }
      },

  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM