user3790770
user3790770

Reputation: 83

Incorrect minimum and maximum in highcharts

I wanted to create a chart with a fixed minimum and maximum. But the problem is that highcharts rounds it down and the values do not correspond.

I have two independent axes like this:

 yAxis:[
           {
                title: {
                    text: "Teplota (°C)"
                },
                gridLineWidth: 0,
                    min: -40,
                    max: 50                     
           },
            {
                title: {
                    text: "Srážky (mm)",
                },  
                opposite: true,
                gridLineWidth: 0,
                min: 0,
                max: 500
            },
    ],

Here is a malfunctioning demo: http://jsfiddle.net/1p1n3zx6/

As you can see, I wanted the minimum to be -40 not -50 and maxium on the other 500 not 600.

Upvotes: 0

Views: 51

Answers (1)

Raein Hashemi
Raein Hashemi

Reputation: 3384

Your tickInterval should be in the correct order for the chart to end on your min and maxes:

yAxis:[
           {
                title: {
                    text: "Teplota (°C)"
                },
                gridLineWidth: 0,
                    min: -40,
                    max: 50,
                    tickInterval: 10
           },
            {
                title: {
                    text: "Srážky (mm)",
                },  
                opposite: true,
                gridLineWidth: 0,
                min: 0,
                max: 500,
                tickInterval: 100
            },
    ]

Here's the DEMO

Upvotes: 2

Related Questions