echarts icon indicating copy to clipboard operation
echarts copied to clipboard

多grid,y轴轴线以及y轴名称不对齐

Open zhouboluo opened this issue 10 years ago • 1 comments

问题简述 (One-line summary)

两个gird,上下排列图形,两个grid的left是一样的,y轴名称到y轴间距也是一样的,但是由于y轴数值范围不同,y轴轴线以及y轴名称不对齐

版本及环境 (Version & Environment)

  • ECharts 版本 (ECharts version):Echarts3.0
  • 浏览器类型和版本 (Browser version):
  • 操作系统类型和版本 (OS Version):

重现步骤 (Steps to reproduce)

期望结果 (Expected behaviour)

图形能够上下对齐

可能哪里有问题 (What went wrong)

感觉grid left的计算是从y轴数值开始的

ECharts配置项 (ECharts option)

option = option = 
{"color":["#1F77B4"],
"animation":false,
"grid":[
{"containLabel":true,"left":92.0,"top":"10.0%","width":"70%","height":"40.0%"},
{"containLabel":true,"left":92.0,"top":"54.0%","width":"70%","height":"40.0%"}
],
"xAxis":[
{"type":"category","name":"ipr_view","axisLabel":{"show":false},"splitLine":{"show":false},"gridIndex":0,"data":["技术秘密","未涉及知识产权"]},
{"type":"category","name":"ipr_view","splitLine":{"show":false},"gridIndex":1,"data":["技术秘密","未涉及知识产权"]}
],
"yAxis":[
{"nameLocation":"middle","type":"value","name":"IndexV1","splitLine":{"show":false},"gridIndex":0,"nameGap":80},
{"nameLocation":"middle","type":"value","name":"IndexV2","splitLine":{"show":false},"gridIndex":1,"nameGap":80}
],
"series":[
{"barWidth":50,"xAxisIndex":0,"yAxisIndex":0,"name":"IndexV1","type":"bar","label":{"normal":{"show":false,"position":"top","textStyle":{"color":"#000000"}}},"data":[{"value":7011801.0},{"value":7585257.0}]},
{"barWidth":50,"xAxisIndex":1,"yAxisIndex":1,"name":"IndexV2","type":"bar","label":{"normal":{"show":false,"position":"top","textStyle":{"color":"#000000"}}},"data":[{"value":678.5256305993775},{"value":763.1311490145806}]}
]
}

其他信息 (Other comments)

zhouboluo avatar Jul 15 '16 06:07 zhouboluo

http://echarts.baidu.com/option.html#grid.containLabel

pissang avatar Jul 15 '16 06:07 pissang