We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
折线图,横轴为时间轴xAxis: { type: 'time' },里面设置min与max时,不能正常显示,图表无数据
代码function randomData() { now = new Date(+now + oneDay); value = value + Math.random() * 21 - 10; return { name: now.toString(), value: [ [now.getFullYear(), now.getMonth() + 1, now.getDate()].join('/'), Math.round(value) ] } } var mi; var data = []; var now = +new Date(1997, 9, 3); var oneDay = 24 * 3600 * 1000; var value = Math.random() * 1000; for (var i = 0; i < 1000; i++) { data.push(randomData()); } option = { title: { text: '动态数据 + 时间坐标轴' }, tooltip: { trigger: 'axis', formatter: function (params) { params = params[0]; var date = new Date(params.name); return date.getDate() + '/' + (date.getMonth() + 1) + '/' + date.getFullYear() + ' : ' + params.value[1]; }, axisPointer: { animation: false } }, dataZoom: [ { type: 'slider', start: 0, end: 100 }, { type: 'inside', start: 0, end: 100 } ], xAxis: { type: 'time', splitLine: { show: false }, min:new Date('1990/1/1') }, yAxis: { type: 'value', boundaryGap: [0, '100%'], splitLine: { show: false } }, series: [{ name: '模拟数据', type: 'line', showSymbol: false, hoverAnimation: false, data: data }] };
The text was updated successfully, but these errors were encountered:
不要写min,max , 直接把你的带有时间的数据 写到series: 下的data 就行。
Sorry, something went wrong.
3ddf66f
[axis] Fix #4097 (enable min/max to be set as Date when using time axis)
d705b69
这个问题困扰我两天,最后看了一下changelog,3.3.0版本修复了这个问题。
No branches or pull requests
问题简述 (One-line summary)
版本及环境 (Version & Environment)
重现步骤 (Steps to reproduce)
期望结果 (Expected behaviour)
可能哪里有问题 (What went wrong)
ECharts配置项 (ECharts option)
其他信息 (Other comments)
The text was updated successfully, but these errors were encountered: