多系列纵向柱状图基本实现
多系列横向柱状图基本实现
多系列纵向柱状图配置
option = {
legend: {
bottom: 0
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
textStyle: {
fontSize: 12
},
},
xAxis: {
type: 'category',
data: ['Brazil', 'Indonesia', 'USA', 'India', 'China', 'World']
},
yAxis: {
type: 'value',
},
series: [
{
name: '中国',
type: 'bar',
data: [182, 234, 290, 104, 131, 230]
},
{
name: '俄罗斯',
type: 'bar',
data: [193, 234, 310, 121, 134, 481]
},
{
name: '刚果共和国',
type: 'bar',
data: [113, 204, 210, 121, 174, 101]
}
]
}
多系列横向柱状图配置
option = {
legend: {
bottom: 0
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
textStyle: {
fontSize: 12,
}
},
xAxis: {
type: 'value',
},
yAxis: {
type: 'category',
data: ['Brazil', 'Indonesia', 'USA', 'India', 'China', 'World']
},
series: [
{
name: '2011',
type: 'bar',
data: [182, 234, 290, 104, 131, 630]
},
{
name: '2012',
type: 'bar',
data: [193, 234, 310, 121, 134, 681]
},
{
name: '2013',
type: 'bar',
data: [113, 204, 210, 121, 174, 101]
}
]
}