[英]Highcharts stream graph - how to make 1:1 scale by Y axis?
Here is my code - https://jsfiddle.net/rxqpt8u4/1/ 这是我的代码-https://jsfiddle.net/rxqpt8u4/1/
var colors = Highcharts.getOptions().colors;
Highcharts.chart('container', {
chart: {
type: 'streamgraph',
marginBottom: 30,
zoomType: 'x'
},
yAxis: {
min:0
},
// Data parsed with olympic-medals.node.js
series: [
{
"name": "Austria",
"data": [
2, 3, 4, 5, 5, 6, 6, 6, 7
]
}]
});
Can't understand why values dont scales 1:1. 无法理解为什么值不按1:1缩放。 Instead of that, they scale 0.5:1.
取而代之的是,它们的缩放比例为0.5:1。 Please advise.
请指教。
The axes adapt to the data and they are independent of each other. 轴适应数据,并且彼此独立。 To have the same scale on the axes set the same
tickInterval
, max
and min
properties: 要在轴上具有相同的比例,请设置相同的
tickInterval
, max
和min
属性:
events: {
load: function() {
var xAxis = this.xAxis[0];
this.yAxis[0].update({
tickInterval: xAxis.tickInterval,
max: xAxis.dataMax
});
}
}
Live demo: https://jsfiddle.net/BlackLabel/289jtzp1/ 现场演示: https : //jsfiddle.net/BlackLabel/289jtzp1/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.