echarts 柱状图_数据量大_自动滚动加载_相关属性dataZoom_常用图表配置_数据可视化

Echarts 常用各类图表模板配置

注意: 这里主要就是基于各类图表,更多的使用 Echarts 的各类配置项;

以下代码都可以复制到 Echarts 官网,直接预览;



echarts 项目可视化、echatrs 横向柱状图滚动、echarts  数据量大,自定滚动,加载数据、echarts 阶梯瀑布图、echarts 阶梯折线图、 ecahrts 折线图、ecahrts柱状图、echarts横向柱状图、echarts折线图+柱状图、echarts 关系图、echarts 知识图谱、ecahrts 地图、ecahrts 地图 josn 文件、地图json免费下载、echarts k线图、echarts环形图、echarts 3D 柱状图、echarts 象形柱图、echarts 自定义样式、echarts 矢量图、echarts 基础教程、echarts 快速入门、echarts 基础配置、charts 图表案例、echarts 大屏可视化、echarts 属性详解、echarts 动画、自定义二分图布局、echarts 力向导图

一、柱状图,数据量大,自动滚动,加载数据

let aircraft =
  'path://M107.000,71.000 C104.936,71.000 102.665,70.806 100.273,70.467 C94.592,76.922 86.275,81.000 77.000,81.000 C70.794,81.000 65.020,79.170 60.172,76.029 C66.952,74.165 72.647,69.714 76.173,63.817 C69.821,61.362 64.063,58.593 60.000,56.039 L60.000,52.813 C70.456,53.950 80.723,55.000 83.000,55.000 C88.972,55.000 93.000,53.723 93.000,50.000 C93.000,47.071 89.222,45.000 83.000,45.000 C80.723,45.000 70.456,46.050 60.000,47.187 L60.000,43.989 C64.057,41.431 69.807,38.644 76.168,36.173 C72.641,30.281 66.948,25.834 60.172,23.971 C65.020,20.830 70.794,19.000 77.000,19.000 C86.270,19.000 94.584,23.074 100.265,29.524 C102.647,29.191 104.918,29.000 107.000,29.000 C129.644,29.000 148.000,50.000 148.000,50.000 C148.000,50.000 129.644,71.000 107.000,71.000 ZM113.000,38.000 C106.373,38.000 101.000,43.373 101.000,50.000 C101.000,56.627 106.373,62.000 113.000,62.000 C119.627,62.000 125.000,56.627 125.000,50.000 C125.000,43.373 119.627,38.000 113.000,38.000 ZM113.000,56.000 C109.686,56.000 107.000,53.314 107.000,50.000 C107.000,46.686 109.686,44.000 113.000,44.000 C116.314,44.000 119.000,46.686 119.000,50.000 C119.000,53.314 116.314,56.000 113.000,56.000 ZM110.500,19.000 C109.567,19.000 108.763,18.483 108.334,17.726 C100.231,9.857 89.187,5.000 77.000,5.000 C64.813,5.000 53.769,9.857 45.666,17.726 C45.237,18.483 44.433,19.000 43.500,19.000 C42.119,19.000 41.000,17.881 41.000,16.500 C41.000,15.847 41.256,15.259 41.665,14.813 L41.575,14.718 C50.629,5.628 63.156,-0.000 77.000,-0.000 C90.844,-0.000 103.371,5.628 112.425,14.718 L112.335,14.813 C112.744,15.259 113.000,15.847 113.000,16.500 C113.000,17.881 111.881,19.000 110.500,19.000 ZM53.000,49.484 C61.406,48.626 77.810,47.000 81.345,47.000 C87.353,47.000 91.000,48.243 91.000,50.000 C91.000,52.234 87.111,53.000 81.345,53.000 C77.810,53.000 61.406,51.374 53.000,50.516 L53.000,49.484 ZM53.000,47.000 L9.000,50.000 L53.000,53.000 L53.000,56.000 L-0.000,50.000 L53.000,44.000 L53.000,47.000 ZM43.500,81.000 C44.433,81.000 45.237,81.517 45.666,82.274 C53.769,90.143 64.813,95.000 77.000,95.000 C89.187,95.000 100.231,90.143 108.334,82.274 C108.763,81.517 109.567,81.000 110.500,81.000 C111.881,81.000 113.000,82.119 113.000,83.500 C113.000,84.153 112.744,84.741 112.335,85.187 L112.425,85.282 C103.371,94.372 90.844,100.000 77.000,100.000 C63.156,100.000 50.629,94.372 41.575,85.282 L41.665,85.187 C41.256,84.741 41.000,84.153 41.000,83.500 C41.000,82.119 42.119,81.000 43.500,81.000 Z';

option = {
  backgroundColor: '#072685',
  tooltip: {
    trigger: 'axis',
    formatter: (v) => {
      return `
            <div>总计:${v[0].value}(亿元)</div>
        `;
    }
  },
  grid: {
    left: '0',
    right: '8%',
    bottom: '20%',
    top: '20%',
    containLabel: true
  },
  xAxis: {
    type: 'value',
    splitLine: {
      show: false
    },
    axisLabel: {
      show: false
    },
    axisTick: {
      show: false
    },
    axisLine: {
      show: false
    }
  },
  yAxis: [
    {
      type: 'category',
      inverse: true,
      axisLine: {
        show: false
      },
      axisTick: {
        show: false
      },
      axisPointer: {
        label: {
          show: true
        }
      },
      pdaaing: [5, 0, 0, 0],
      postion: 'right',
      data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
      axisLabel: {
        margin: 30,
        fontSize: 10,
        align: 'left',
        padding: [2, 0, 0, 0],
        color: '#000',
        rich: {
          nt1: {
            color: '#fff',
            backgroundColor: '#EB3B5A',
            width: 13,
            height: 13,
            fontSize: 10,
            align: 'center',
            borderRadius: 100,
            padding: 1
          },
          nt2: {
            color: '#fff',
            backgroundColor: '#FA8231',
            width: 13,
            height: 13,
            fontSize: 10,
            align: 'center',
            borderRadius: 100,
            padding: 1
          },
          nt3: {
            color: '#fff',
            backgroundColor: '#F7B731',
            width: 13,
            height: 13,
            fontSize: 10,
            align: 'center',
            borderRadius: 100,
            padding: 1
          },
          nt: {
            color: '#fff',
            backgroundColor: '#3860FC',
            width: 13,
            height: 13,
            fontSize: 10,
            align: 'center',
            borderRadius: 100,
            padding: 1
          }
        },
        formatter: function (value, index) {
          if (index < 3) {
            return `{nt${index + 1}|${value}}`;
          } else {
            return `{nt|${value}}`;
          }
        }
      }
    },
    {
      type: 'category',
      inverse: true,
      axisTick: 'none',
      axisLine: 'none',
      show: true,
      axisLabel: {
        color: '#fff',
        fontSize: '10',
        rich: {
          a0: { fontSize: 28, color: '#ff7f97', verticalAlign: 'bottom' },
          a1: { fontSize: 24, color: '#ffce64', verticalAlign: 'bottom' },
          a2: { fontSize: 24, color: '#e8ed66', verticalAlign: 'bottom' },
          a3: { fontSize: 24, color: '#98bfff', verticalAlign: 'bottom' },

          b0: { fontSize: 12, color: '#ff7f97', verticalAlign: 'bottom' },
          b1: { fontSize: 12, color: '#ffce64', verticalAlign: 'bottom' },
          b2: { fontSize: 12, color: '#e8ed66', verticalAlign: 'bottom' },
          b3: { fontSize: 12, color: '#98bfff', verticalAlign: 'bottom' }
        },
        formatter: (params, index) => {
          if (index < 3) {
            return `{a${index}|${params}}  {b${index}|%}`;
          } else {
            return `{a3|${params}}  {b3|%}`;
          }
        }
      },
      data: ['24', '23', '22', '21', '20', '19', '18', '17', '16', '15']
    },
    {
      //名称
      type: 'category',
      offset: -10,
      position: 'left',
      axisLine: {
        show: false
      },
      inverse: true,
      axisTick: {
        show: false
      },
      axisLabel: {
        interval: 0,
        color: '#fff',
        align: 'left',
        verticalAlign: 'bottom',
        lineHeight: 32,
        fontSize: 10
      },
      data: [
        '2024【24.96】',
        '2023【23.06】',
        '2022【22.06】',
        '2021【21.06】',
        '2020【20.06】',
        '2019【19.06】',
        '2018【18.06】',
        '2017【17.06】',
        '2016【16.06】',
        '2015【15.06】'
      ]
    }
  ],
  series: [
    {
      z: 6,
      type: 'pictorialBar',
      data: [
        {
          value: '24.96',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#EB3B5A' },
                { offset: 1, color: '#FE9C5A' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          },
          symbol: 'none'
        },
        {
          value: '23.06',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#FA8231' },
                { offset: 1, color: '#FFD14C' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          },
          symbol: aircraft, // 「小飞机」
          symbolPosition: 'end', // 在数据结尾显示
          symbolSize: [30, 25], // 「飞机大小」
          symbolOffset: [35, 0] //「偏移量」
        },
        {
          value: '22.06',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#F7B731' },
                { offset: 1, color: '#FFEE96' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          },
          symbol: aircraft,
          symbolPosition: 'end',
          symbolSize: [30, 25],
          symbolOffset: [35, 0]
        },
        {
          value: '21.06',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#395CFE' },
                { offset: 1, color: '#2EC7CF' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          },
          symbol: aircraft,
          symbolPosition: 'end',
          symbolSize: [30, 25],
          symbolOffset: [35, 0]
        },
        {
          value: '20.06',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#395CFE' },
                { offset: 1, color: '#2EC7CF' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          },
          symbol: aircraft,
          symbolPosition: 'end',
          symbolSize: [30, 25],
          symbolOffset: [35, 0]
        },
        {
          value: '19.06',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#395CFE' },
                { offset: 1, color: '#2EC7CF' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          },
          symbol: aircraft,
          symbolPosition: 'end',
          symbolSize: [30, 25],
          symbolOffset: [35, 0]
        },
        {
          value: '18.06',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#395CFE' },
                { offset: 1, color: '#2EC7CF' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          },
          symbol: aircraft,
          symbolPosition: 'end',
          symbolSize: [30, 25],
          symbolOffset: [35, 0]
        },
        {
          value: '17.06',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#395CFE' },
                { offset: 1, color: '#2EC7CF' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          },
          symbol: aircraft,
          symbolPosition: 'end',
          symbolSize: [30, 25],
          symbolOffset: [35, 0]
        },
        {
          value: '16.06',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#395CFE' },
                { offset: 1, color: '#2EC7CF' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          },
          symbol: aircraft,
          symbolPosition: 'end',
          symbolSize: [30, 25],
          symbolOffset: [35, 0]
        },
        {
          value: '15.06',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#395CFE' },
                { offset: 1, color: '#2EC7CF' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          },
          symbol: aircraft,
          symbolPosition: 'end',
          symbolSize: [30, 25],
          symbolOffset: [35, 0]
        }
      ]
    },
    {
      zlevel: 1,
      name: '个人所得(亿元)',
      type: 'bar',
      barWidth: 15,
      animationDuration: 1500,
      data: [
        {
          value: '24.96',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#EB3B5A' },
                { offset: 1, color: '#FE9C5A' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          }
        },
        {
          value: '23.06',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#FA8231' },
                { offset: 1, color: '#FFD14C' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          }
        },
        {
          value: '22.06',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#F7B731' },
                { offset: 1, color: '#FFEE96' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          }
        },
        {
          value: '21.06',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#395CFE' },
                { offset: 1, color: '#2EC7CF' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          }
        },
        {
          value: '20.06',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#395CFE' },
                { offset: 1, color: '#2EC7CF' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          }
        },
        {
          value: '19.06',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#395CFE' },
                { offset: 1, color: '#2EC7CF' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          }
        },
        {
          value: '18.06',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#395CFE' },
                { offset: 1, color: '#2EC7CF' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          }
        },
        {
          value: '17.06',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#395CFE' },
                { offset: 1, color: '#2EC7CF' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          }
        },
        {
          value: '16.06',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#395CFE' },
                { offset: 1, color: '#2EC7CF' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          }
        },
        {
          value: '15.06',
          itemStyle: {
            color: {
              colorStops: [
                { offset: 0, color: '#395CFE' },
                { offset: 1, color: '#2EC7CF' }
              ],
              x: 0,
              y: 1,
              x2: 1,
              y2: 1,
              type: 'linear',
              global: false
            }
          }
        }
      ],
      align: 'center',
      itemStyle: {
        normal: {
          barBorderRadius: 10
        }
      },
      label: {
        show: true,
        fontSize: 10,
        color: '#fff',
        textBorderWidth: 2,
        padding: [2, 0, 0, 0]
      }
    },
    {
      name: '个人所得(亿元)',
      type: 'bar',
      barWidth: 15,
      barGap: '-100%',
      data: [
        24.96, 24.96, 24.96, 24.96, 24.96, 24.96, 24.96, 24.96, 24.96, 24.96
      ],
      textStyle: {
        //图例文字的样式
        fontSize: 10,
        color: '#fff'
      },
      itemStyle: {
        color: 'rgba(255,255,255,.1)',
        fontSize: 10,
        barBorderRadius: 30
      }
    }
  ],
  dataZoom: [
    {
      yAxisIndex: [0, 1, 2], // 关键配置
      type: 'slider',
      show: false,
      startValue: 0,
      endValue: 3
    }
  ]
};

let index = 3;
function doing() {
  setInterval(() => {
    index++;
    if (index == 10) {
      index = 3;
    }
    option.dataZoom = [
      {
        yAxisIndex: [0, 1, 2],
        type: 'slider',
        show: false,
        startValue: index - 3,
        endValue: index
      }
    ];
    myChart.setOption(option);
  }, 1000);
}
setTimeout(doing, 1000);

二、折线图

echarts 折线图,横纵坐标轴线颜色、文字颜色,网格线,坐标轴两侧留白,数据渐变,刻度线等;

文章链接:https://blog.csdn.net/aibujin/article/details/140823248?spm=1001.2014.3001.5501

文章链接:https://blog.csdn.net/aibujin/article/details/124802512?spm=1001.2014.3001.5501

文章链接:https://blog.csdn.net/aibujin/article/details/130157140?spm=1001.2014.3001.5501

文章链接:https://blog.csdn.net/aibujin/article/details/130223130?spm=1001.2014.3001.5501

三、阶梯折线图

文章链接: https://blog.csdn.net/aibujin/article/details/140876408?spm=1001.2014.3001.5501

四、折线图数据分区

文章链接:https://blog.csdn.net/aibujin/article/details/141104797?spm=1001.2014.3001.5501

五、折线图,数据量大,自动滚动,加载数据

文章链接:https://blog.csdn.net/aibujin/article/details/140922448?spm=1001.2014.3001.5501

六、横向柱状图

echarts 横向柱状图,坐标轴隐藏,网格线颜色渐变,网格默认背景,柱状图边框宽度/颜色,数据渐变,刻度线隐藏等;

文章链接: https://blog.csdn.net/aibujin/article/details/124802889?spm=1001.2014.3001.5501

七、柱状图数据分区

文章链接:https://blog.csdn.net/aibujin/article/details/140932127?spm=1001.2014.3001.5501

八、折线图 + 柱状图

echarts 折线图 + 柱状图,左右两侧y轴线,横纵坐标轴线颜色、文字颜色,网格线,坐标轴两侧留白,数据渐变,刻度线等;

文章链接: https://blog.csdn.net/aibujin/article/details/124803493?spm=1001.2014.3001.5501

九、3D 柱状图

echarts 3D 柱状图,多个柱状图叠加,y轴内刻度线、隐藏横坐标,文字颜色,网格线,坐标轴两侧留白,数据渐变,刻度线等;

文章链接: https://blog.csdn.net/aibujin/article/details/124879825?spm=1001.2014.3001.5501

十、环形图

echarts 环形图:多层嵌套,自定义 legend 位置、颜色,中间插入数据及文字,颜色渐变;

文字链接: https://blog.csdn.net/aibujin/article/details/124796709?spm=1001.2014.3001.5501

十一、k 线图

文章链接: https://blog.csdn.net/aibujin/article/details/124797924?spm=1001.2014.3001.5501

十二、工程项目可视化

echarts 工程项目可视化,依据x轴时间坐标轴,叠加展示不同阶段的项目节点,y轴展示项目阶段名、文字颜色,网格线,坐标轴两侧留白、背景色等;

文章链接: https://blog.csdn.net/aibujin/article/details/130237643?spm=1001.2014.3001.5501

十三、雷达图

echarts 雷达图,自定义指示器名称,线条样式、区域填充样式、折线拐点标志、自定义名称样式、坐标轴分隔线、坐标轴两侧留白、背景色等;

文章链接:https://blog.csdn.net/aibujin/article/details/130266382?spm=1001.2014.3001.5501

十四、象形柱图

echarts 象形柱图,隐藏横纵坐标轴、网格线,坐标轴两侧留白,自定义矢量图,文字提示框、图形类型、背景色等;

文章链接:https://blog.csdn.net/aibujin/article/details/130289101?spm=1001.2014.3001.5501

十五、环形占比图

echarts 环形占比图,环形图、仪表盘、刻度线,自定义提示框、颜色渐变、背景色等;

文章链接:https://blog.csdn.net/aibujin/article/details/130265744?spm=1001.2014.3001.5501

十六、圆环动画

echarts 圆环动画,饼图、环形图、图表动画、网格线,颜色渐变,图行矢量,文字提示框、图表层级、背景色等;

文章链接:https://blog.csdn.net/aibujin/article/details/130288849?spm=1001.2014.3001.5501

十七、力向导图(二分图布局)

文章链接:https://blog.csdn.net/aibujin/article/details/134148974?spm=1001.2014.3001.5501
文章链接:https://blog.csdn.net/aibujin/article/details/134690784?spm=1001.2014.3001.5501
文章链接:https://blog.csdn.net/aibujin/article/details/134147640?spm=1001.2014.3001.5502

十八、地图

echarts 地图,自定义提示框;

文章链接:https://blog.csdn.net/aibujin/article/details/130532911?spm=1001.2014.3001.5501

十九、地图 json 免费下载

  1. 全省份 json 下载:https://mp.csdn.net/mp_download/manage/download/UpDetailed?spm=3001.5299

  2. 阿里数据可视化平台下载:http://datav.aliyun.com/portal/school/atlas/area_selector

在这里插入图片描述
3. https://geojson.cn/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值