var dom1 = document.getElementById('id1');
var instance1 = echarts.init(dom1);
var option1 = {
xAxis: [{...}, {...}],
yAxis: [{...}, {...}],
grid: [{...}, {...}],
series: [
{type: 'line', data: [...]},
{type: 'bar', data: [...]},
{type: 'bar', data: [...]},
{type: 'pie', data: [...]}
}]
};
instance1.setOption(option1);
var dom2 = document.getElementById('id2');
var chart2 = echarts.init(dom2);
var option2 = {
xAxis: {...},
yAxis: {...},
grid: {...},
series: {type: 'bar', data: [...]}
};
chart2.setOption(option2);
var option = {
xAxis: {
data: [
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
]
},
yAxis: {},
series: [{
type: 'pie',
center: ['65%', 60],
radius: 35,
data: [
{name: 'XX', value: 52},
{name: 'YY', value: 54},
{name: 'ZZ', value: 42}
]
}, {
type: 'line',
data: [34, 28, 45, 69, 39, 43, 33, 23, 23, 33, 39, 22]
}, {
type: 'bar',
data: [20, 14, 32, 46, 24, 23, 23, 13, 16, 20, 24, 15]
}]
};
var option = {
xAxis: {type: 'category'},
yAxis: {},
dataset: {
source: [
[ 'Jan' , 34 , 20 , 'XX' , 52 ],
[ 'Feb' , 28 , 14 , 'YY' , 54 ],
[ 'Mar' , 45 , 32 , 'ZZ' , 42 ],
[ 'Apr' , 69 , 46 ],
[ 'May' , 39 , 24 ],
[ 'Jun' , 43 , 23 ],
[ 'Jul' , 33 , 23 ],
[ 'Aug' , 23 , 13 ],
[ 'Sep' , 23 , 16 ],
[ 'Oct' , 33 , 20 ],
[ 'Nov' , 39 , 24 ],
[ 'Dec' , 22 , 15 ],
]
},
series: [{
type: 'pie',
center: ['65%', 60],
radius: 35,
encode: {itemName: 3, value: 4}
}, {
type: 'line',
encode: {x:0, y: 1}
}, {
type: 'bar',
encode: {x:0, y: 2}
}]
};
var option = {
legend: {...},
toolbox: {...},
tooltip: {...},
dataZoom: [{...}, {...}],
visualMap: {...},
xAxis: [{...}],
yAxis: [{...}],
grid: [{...}],
dataset: {
source: [...]
},
series: [{
type: 'line',
...
}, {
type: 'bar',
...
}]
};
var option = {
grid: {
left: 130,
right: '30%',
height: '40%',
bottom: 110
},
xAxis: {...},
yAxis: {...},
series: [{...}, {...}]
};
var option = {
xAxis: {},
yAxis: {},
series: {
type: 'scatter',
data: [
[13, 44],
[51, 51],
[51, 32],
[67, 19],
[19, 33]
]
}
}
var option = {
xAxis: {
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: [
{...},
{...}
],
series: [{
type: 'bar',
data: [242, 344, 324, 475, 264, 467, 531],
yAxisIndex: 0
}, {
type: 'line',
data: [44, 51, 32, 19, 33, 24, 12],
yAxisIndex: 1
}]
};
var option = {
dataset: {source: [...]},
grid: [
{top: 40, bottom: '58%'},
{top: '58%', bottom: 40}
],
xAxis: [
{type: 'category', gridIndex: 0},
{type: 'category', gridIndex: 1}
],
yAxis: [
{type: 'value', gridIndex: 0},
{type: 'value', gridIndex: 1}
],
series: [{
type: 'line',
xAxisIndex: 0,
yAxisIndex: 0
}, {
type: 'line',
xAxisIndex: 1,
yAxisIndex: 1
}, {
type: 'bar',
xAxisIndex: 1,
yAxisIndex: 1
}]
};