Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我有一个图表并且所有数据都为零时,x 轴居中。(jsfiddle)
但我需要从图表底部开始,如下所示:
我怎样才能用 HighChart 做到这一点。
设置 yAxismax和min.
max
min
yAxis: { max: 0.06, min: 0 }
演示
对于动态修改。
function preventZeroLabel() { var axis = this.yAxis[0]; if( -axis.min == axis.max ) { axis.setExtremes(0, 1, true); } } chart: { events: { load: preventZeroLabel, redraw: preventZeroLabel } }