//柱状图
var barGragh = document.getElementById('barGragh');
var barChart = echarts.init(barGragh);
var barChartoption = {
tooltip: {
trigger: 'axis'
},
legend: {
data: ['上周同比', '今日整点'],
/* y : 'bottom' */
},
toolbox: {
show: false,
feature: {
mark: {show: true},
dataView: {show: true, readOnly: false},
magicType: {show: true, type: ['line', 'bar']},
restore: {show: true},
saveAsImage: {show: true}
}
},
color : ['#ff7f50','#87cefa', '#61a0a8', '#d48265', '#91c7ae','#749f83', '#ca8622', '#bda29a','#6e7074', '#546570', '#c4ccd3'],
calculable: false,
grid: {
left: '0%',
right: '0%',
bottom: '5%',
containLabel: true
},
xAxis: [
{
type: 'category',
data: []
}
],
yAxis: [
{
type: 'value',
name: 'GMV'
}
],
series: [
{
name: '上周同比',
type: 'bar',
barMaxWidth: '100',
data: [],
markPoint: {
data: [
{type: 'max', name: '最大值'},
{type: 'min', name: '最小值'}
]
},
markLine: {
data: [
{type: 'average', name: '平均值'}
]
}
},
{
name: '今日整点',
type: 'bar',
barMaxWidth: '100',
data: [],
markPoint: {
data: [
{type: 'max', name: '最大值'},
{type: 'min', name: '最小值'}
]
},
markLine: {
data: [
{type: 'average', name: '平均值'}
]
}
}
]
};
barChart.setOption(barChartoption);
————————————————
版权声明:本文为CSDN博主「小魏的马仔」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/xuexiiphone/article/details/62228751