当前位置: 首页>前端>正文

echarts基础图表

echarts基础图表,第1张
 myChart.setOption({
         xAxis: {
          type: "category",
          axisLine: {
            show: true,
            lineStyle: {
              color: "rgba(0,0,0,0)",
            },
          },
          axisTick: {
            show: true,
          },
          axisLabel: {
            show: true,
            color: "rgba(240,240,240,0.7)",
          },
          splitLine: {
            show: false,
            lineStyle: {
              type: "solid",
              color: "rgba(0,0,0,0.1)",
            },
          },
          boundaryGap: true,
    
          data: ["1月", "2月", "3月", "4月", "5月","6月","7月","8月","9月","10月","11月","12月"],
        },
         tooltip: {
          show: true,
          backgroundColor: "rgba(0,0,0,.51)",
          borderWidth: 0,
         icon:'none',
          trigger: "axis",
       
        },
         legend: {
          itemWidth: 10,
          itemHeight: 10,
          icon: "rect",
          textStyle: {
            color: "#B7BCBB",
          },
          right: 30,
        },
        yAxis: {
          type: "value",
          axisLine: {
            show: false,
          },
          axisTick: {
            show: false,
          },
          axisLabel: {
            color: "rgba(240,240,240,0.7)",
          },
          nameTextStyle: {
            color: "rgba(240,240,240,0.7)",
          },
          splitLine: {
            lineStyle: {
              color: "rgba(238,238,238, .1)",
            },
          },
          splitNumber: 3,
        },
         grid: {
           top: "15%",
           left:'5%',
          right: "3%",
          bottom:'10%'
        
        },
        series: [
          {
            data: [150, 230, 224, 218, 135, 147, 260,241,158,99,255,187],
            type: "line",
            symbol: 'circle',
            name:'成交金额(万元)',
             areaStyle: {
                color: graphic_Linear([
                  {
                    color: '#0DC4AA',
                    offset: 0
                  },
                  {
                    color: 'rgba(13, 196, 170, 0.1)',
                    offset: .6
                  },
                  {
                    color: 'rgba(13, 196, 170, 0.1)',
                    offset: .6
                  },
                  {
                    color: 'rgba(255,255,255,0)',
                    offset: 1
                  }
                ], 'TB')
              },
              stack: 'Total',
            itemStyle:{
                color:'rgba(13, 196, 170, 1)'

            }
          },
             {
                 stack: 'Total',
            data: [170, 330, 254, 418, 235, 157, 210,323,364,248,558,214],
            type: "line",
            name:'交易人次(人次)',
             areaStyle: {
                color: graphic_Linear([
                  {
                    color: '#0DC4AA',
                    offset: 0
                  },
                  {
                    color: 'rgba(255, 183, 52, .1)',
                    offset: .6
                  },
                    {
                    color: 'rgba(255, 183, 52, .1)',
                    offset: .6
                  },
                  
                  {
                    color: 'rgba(255, 183, 52, 0)',
                    offset: 1
                  }
                ], 'TB')
              },
            symbol: 'circle',
            itemStyle:{
                color:'rgba(255, 183, 52, 1)'
            }
          },
        ],
      });
echarts基础图表,第2张
 myChart.setOption({
        color: [
          "rgba(13, 196, 170, 0.2)",
          "rgba(255, 183, 52, 0.2)",
          "rgba(183, 188, 187, 0.2)",
        ],
        tooltip: {
          show: true,
          backgroundColor: "rgba(0,0,0,.51)",
          borderWidth: 0,
          padding: 20,
          trigger: "axis",
          axisPointer: {
            type: "line",
          },
          textStyle: {
            color: "#B7BCBB",
          },
        },
        xAxis: {
          type: "category",
          axisLine: {
            show: true,
            lineStyle: {
              color: "rgba(0,0,0,0)",
            },
          },
          axisTick: {
            show: true,
          },
          axisLabel: {
            show: true,
            color: "rgba(240,240,240,0.7)",
          },
          splitLine: {
            show: false,
            lineStyle: {
              type: "solid",
              color: "rgba(0,0,0,0.1)",
            },
          },
          boundaryGap: true,
          // data: ["兰州", "张掖", "武威", "天水", "酒泉", "定西", "甘商", "嘉峰关", "白银市"],
          // data: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
          data: ["陕西", "河北", "上海", "北京", "甘肃"],
        },
        yAxis: {
          type: "value",
          axisLine: {
            show: false,
          },
          axisTick: {
            show: false,
          },
          axisLabel: {
            color: "rgba(240,240,240,0.7)",
          },
          nameTextStyle: {
            color: "rgba(240,240,240,0.7)",
          },
          splitLine: {
            lineStyle: {
              color: "rgba(238,238,238, .1)",
            },
          },
          splitNumber: 3,
        },
        grid: {
          top: "20%",
          right: "3%",
          y: 20,
          y2: 20,
        },
        legend: {
          itemWidth: 10,
          itemHeight: 10,
          icon: "rect",
          textStyle: {
            color: "#B7BCBB",
          },
          right: 30,
        },
        series: [
          {
            name: "累计成交金额",
            type: "bar",
            barWidth: 14,
            // stack: "Ad",

            itemStyle: {
              borderColor: "#0DC4AA",
            },
            // data: [100, 150, 230, 100, 150, 100, 100, 150, 100, 100],
            data: [543, 4267, 6334, 3165, 7746, 5112, 4935, 1203, 1568, 1612],
          },
          {
            name: "参与交易人次",
            type: "bar",
            barWidth: 14,
            // stack: "Ad",

            itemStyle: {
              borderColor: "#FFB734",
            },
            // data: [150, 100, 150, 150, 100, 120, 120, 150, 100, 120],
            data: [0, 2092, 5684, 2557, 6506, 4885, 4164, 381, 1934, 1644],
          },
        ],
      });

https://www.xamrdz.com/web/2p51997356.html

相关文章: