Alvaro
Alvaro

Reputation: 41595

Change Highstocks.js Y axis value

I'm not quite sure how Highstocks is drawing my graphic. The starting point for the Y-axis is always 0 for any series when their values are always over that value.

In some cases the values are negative in the Y-axis and sometimes multiple series overlap each other when they have very different values between them.

I'm probably misunderstanding how it's working but I can not find more information about it. Any help will be appreciated.


enter image description here


The highest value is under the lowest one?

enter image description here

$.getJSON(baseUrl + "monitor/data", function (data) {
    console.log(data);

    var seriesOptions = [];

    $.each(data, function (i, item) {
        console.log(item);

        seriesOptions.push({
            name: i,
            data: item,
        });
    });



    chart = new Highcharts.StockChart({
        chart: {
            renderTo: 'stats'
        },

        rangeSelector: {
            selected: 0
        },

        plotOptions: {
            series: {
                compare: 'value',
                pointInterval: 1000 * 30
            }
        },

        tooltip: {
            pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y} K</b> ({point.change}%)<br/>',
            yDecimals: 1,
            shared: true
        },

        series: seriesOptions
    });

});

Upvotes: 0

Views: 81

Answers (1)

Paweł Fus
Paweł Fus

Reputation: 45079

Solution is to remove 'compare' option.

Reference.

Upvotes: 1

Related Questions