Highcharts y-axis Ceiling not being respected

前端 未结 3 1039
一整个雨季
一整个雨季 2021-01-14 00:51

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

相关标签:
3条回答
  • 2021-01-14 01:30

    You can always create your own tickPositioner, or set directly tickPositions: http://jsfiddle.net/2bzew/4/

    See docs and more examples:

    • tickPositioner
    • tickPositions
    0 讨论(0)
  • 2021-01-14 01:38

    I had a similar problem, but I found that using the following solves the issue:

            maxPadding: 0,
            minPadding: 0,
    

    The default for these values are both 0.05 so that will be added to your data and cause highstock to make the y axis bigger than intended. Zeroing them out seems to fix the problem for me.

    I also recommend to set the following so that maximum value still has a label:

            showLastLabel: true,
    

    http://jsfiddle.net/M4bVz/

    0 讨论(0)
  • 2021-01-14 01:39

    From Highcharts API:

    When using multiple axis, the ticks of two or more opposite axes will automatically be aligned by adding ticks to the axis or axes with the least ticks. This can be prevented by setting alignTicks to false. If the grid lines look messy, it's a good idea to hide them for the secondary axis by setting gridLineWidth to 0. Defaults to true.

    I have updated your fiddle with these corrections.

    chart: {
            alignTicks: false
        },
    ...
    yAxis: [{
                ...
                gridLineWidth: 0,
                ...
    

    http://jsfiddle.net/2bzew/3/

    0 讨论(0)
提交回复
热议问题