Echarts Dataset
ECharts uses dataset to manage data.
The dataset component is used to declare a separate dataset, so that data can be managed separately, reused by multiple components, and data can be mapped to visuals based on the data.
Below is the simplest example of dataset:
## Instance
option ={
legend:{},
tooltip:{},
dataset:{
// Provide a data.
source:[
['product','2015','2016','2017'],
['Matcha Latte',43.3,85.8,93.7],
['Milk Tea',83.1,73.4,55.1],
['Cheese Cocoa',86.4,65.2,82.5],
['Walnut Brownie',72.4,53.9,39.1]
]
},
// Declare an X axis, category axis. By default, the category axis corresponds to the first column of the dataset.
xAxis:{type:'category'},
// Declare a Y axis, value axis.
yAxis:{},
// Declare multiple bar series, by default, each series will automatically correspond to each column of the dataset.
series:[
{type:'bar'},
{type:'bar'},
{type:'bar'}
]
}
[Try it Yourself Β»](#)
Or you can use the common object array format:
## Instance
option ={
legend:{},
tooltip:{},
dataset
YouTip