javascript - Highcharts 流图 - 如何按 Y 轴进行 1: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
]
}]
});
无法理解为什么值不按 1:1 比例缩放。取而代之的是,它们的比例为 0.5:1。请指教。
解决方案
轴适应数据并且彼此独立。要在轴上设置相同的比例,请设置相同的tickInterval
,max
和min
属性:
events: {
load: function() {
var xAxis = this.xAxis[0];
this.yAxis[0].update({
tickInterval: xAxis.tickInterval,
max: xAxis.dataMax
});
}
}
推荐阅读
- android - 为什么我的 android studio 在安装(运行)后没有自动启动应用程序
- dialogflow-es - 如何修复:“查询模式 'zeige mir deine $media:media-Seite' 包含未定义的参数(名称:'media-Seite' 类型:'media')”
- autosuggest - 如何在 Sailfish OS 中禁用烦人的键盘建议?
- matlab - Matlab中NaN的值似乎是错误的
- scala - 替换字符串的3个首字母的函数
- gmail-api - 如何使用 Gmail API 获取特定线程的标签
- powershell - PowerShell 计算机启动脚本 - 切换用户上下文?
- r - lapply 带有多个函数参数
- javascript - 摆脱可变的`let`
- php - PHP 在脚本之间传递一个 ID