echarts
echarts copied to clipboard
Y轴使用dataZoom时,toolTip提示有误
Y轴使用dataZoom时,没有数据时,toolTip会显示最后一条记录
版本及环境 (Version & Environment)
- ECharts 版本 (V3.1.9):
- 浏览器类型和版本 (Google Chrom 49.0):
- 操作系统类型和版本 (win10 x64):
重现步骤 (Steps to reproduce)
1.数据移动到6月份坐标上 2.toolTip提示框中2015年数据正常,2016年6月无数据,但显示的是2016年5月份的数据
期望结果 (Expected behaviour)
无数据时,显示为"-"
ECharts配置项 (ECharts option)
option = {
"legend": {
"show": true,
"y": "bottom",
"data": [
{
"name": "2015年"
},
{
"name": "2016年"
},
{
"name": "本年月均室外温度"
}
]
},
"xAxis": {
"data": [
"01月",
"02月",
"03月",
"04月",
"05月",
"06月",
"07月",
"08月",
"09月",
"10月",
"11月",
"12月"
]
},
"yAxis": [
{
"type": "value",
"name": "水(m³)",
},
{
"type": "value",
"name": "温度(℃)",
}
],
"dataZoom": [
{
"type": "slider",
"show": true,
"width": "12",
"yAxisIndex": [
0
]
}
],
"tooltip": {
"trigger": "axis",
},
"series": [
{
"type": "bar",
"name": "2015年",
"data": ["145727.99","70676.14","177730.16","176882.99","182839.89","192839.89"],
},
{
"type": "bar",
"name": "2016年",
"data": ["155727.99","80676.14","277730.16","231882.99","152839.89"],
},
]
}
数据需要对齐
2016年6月份没数据,用null或"-"代替,结果还是一样,toolTip显示的还是5月份的值
好像是因为引入 y 轴的 dataZoom 产生的问题
是的,去掉dataZoom 就没问题了
This issue is closed due to not being active. Please feel free to open it again (for the author) or create a new one and reference this (for others) if you have further questions.