Highcharts y轴天花板不被尊重 [英] Highcharts y-axis Ceiling not being respected
问题描述
Y轴1代表百分比值,代表百分比值,所以楼层为0,上限为100。
Y轴2代表货币价值,所以楼层为0,天花板为 null 。
由于某些原因,y轴1的标签上升到150。
如果我更改相应的系列数据,以便将值0更改为20,问题似乎消失,标签停在100处。
var dataX = [0,67,43,100,100,80];
var dataY = [950,900,807,650,600,450];
$(函数(){
$('#container')。highcharts({
系列:[{
name:'Series 1 ',
data:dataX,
yAxis:0},
{
name:'Series 2',
data:dataY,
yAxis:1 }],
yAxis:[{
floor:0,
ceiling:100,
title:{
text:'1'
},
},
{
floor:0,
ceiling:null,
title:{
text:'2'
},
opposite:true}]});}); b
$ b nofollow> http://jsfiddle.net/2bzew/2/
任何人都可以解释为什么会发生这种情况吗?
你可以创建自己的 tickPositioner
,或者直接设置 tickPositions code>: http://jsfiddle.net/2bzew/4/
查看文档和更多示例:
- tickPositioner
.tickPositionsrel =nofollow> tickPositions
I have a problem with Highcharts where the Ceiling of one of my two y-axes is not being respected.
Y-axis "1" represents percentage values, so has a Floor of 0 and a Ceiling of 100.
Y-axis "2" represents monetary values, so has a Floor of 0 and a Ceiling of null.
For some reason, the labels for y-axis "1" go up to 150.
If I change the corresponding series data so that the value 0 is changed to 20, the problem seems to go away and the labels stop at 100 as they should.
var dataX = [0, 67, 43, 100, 100, 80];
var dataY = [950, 900, 807, 650, 600, 450];
$(function () {
$('#container').highcharts({
series: [{
name: 'Series 1',
data: dataX,
yAxis: 0},
{
name: 'Series 2',
data: dataY,
yAxis: 1}],
yAxis: [{
floor: 0,
ceiling: 100,
title: {
text: '1'
},
},
{
floor: 0,
ceiling: null,
title: {
text: '2'
},
opposite: true}]});});
Can anyone explain why this is happening?
解决方案 You can always create your own tickPositioner
, or set directly tickPositions
: http://jsfiddle.net/2bzew/4/
See docs and more examples:
这篇关于Highcharts y轴天花板不被尊重的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!