Echarts可视化教程

  1. 网站首页
  2. 百度ECharts
  3. ECharts实例
  4. ECharts入门
  5. 地图大全
  6. ECharts官网

百度Echarts数据集dataset的基本用法

option = {
  legend: {},
  tooltip: {},
  dataset: {
    source: [
      ['product', '2020', '2021', '2022', '2023'],
      ['Matcha Latte', 41.1, 30.4, 65.1, 53.3],
      ['Milk Tea', 86.5, 92.1, 85.7, 83.1],
      ['Cheese Cocoa', 24.1, 67.2, 79.5, 86.4]
    ]
  },
  xAxis: [
    {type: 'category', gridIndex: 0},
    {type: 'category', gridIndex: 1}
  ],
  yAxis: [
    {gridIndex: 0},
    {gridIndex: 1}
  ],
  grid: [
    {bottom: '55%'},
    {top: '55%'}
  ],
  series: [
    // 这几个系列会在第一个直角坐标系中,每个系列对应到 dataset 的每一行。
    {type: 'bar', seriesLayoutBy: 'row'},
    {type: 'bar', seriesLayoutBy: 'row'},
    {type: 'bar', seriesLayoutBy: 'row'},
    // 这几个系列会在第二个直角坐标系中,每个系列对应到 dataset 的每一列。
    {type: 'bar', xAxisIndex: 1, yAxisIndex: 1},
    {type: 'bar', xAxisIndex: 1, yAxisIndex: 1},
    {type: 'bar', xAxisIndex: 1, yAxisIndex: 1},
    {type: 'bar', xAxisIndex: 1, yAxisIndex: 1}
  ]
}
点击展开全文

相关文章

  1. 百度Echarts事件处理方法介绍
  2. 百度Echarts修改颜色主题
  3. 百度Echarts中tooltip参数用法介绍
  4. 百度Echarts柱形图series参数用法介绍
  5. 百度Echarts中dataZoom纵向滚动条参数用法介绍