【求助】如何将统计图的左右两侧的Y轴都变成正的呢
echarts吧
全部回复
仅看楼主
level 2
千羽秋明 楼主
option = {
tooltip : {
trigger: 'axis',
axisPointer : { // 坐标轴指示器,坐标轴触发有效
type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
legend: {
data: ['直接访问', '邮件营销','联盟广告','视频广告','搜索引擎']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'value'
},
yAxis: {
type: 'category',
data: ['周一','周二','周三','周四','周五','周六','周日']
},
series: [
{
name: '直接访问',
type: 'bar',
stack: '总量',
label: {
normal: {
show: true,
position: 'insideRight'
}
},
data: [320, 302, 301, 334, 390, 330, 320]
},
{
name: '搜索引擎',
type: 'bar',
stack: '总量',
label: {
normal: {
show: true,
position: 'insideRight'
}
},
data: [-820, -832, -901, -934, -1290, -1330, -1320]
}
]
};
2016年05月10日 15点05分 1
level 1
把倒数第四行 data 负值删掉
2016年06月01日 02点06分 2
level 2
千羽秋明 楼主
指的是左右两侧X轴都为正,如果把data后的数据负号去掉,就都只能在右侧的显示为正数了,就没有左侧了
http://echarts.baidu.com/echarts2/doc/example/bar5.html
2016年06月01日 12点06分 3
level 1
楼主找到方法了吗
2018年01月29日 02点01分 4
1