score:2

Accepted answer

You can stick you chart to the bottom using threshold property. Like this:

$(function () {
    var chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
        },
        plotOptions: {
        series: {
            threshold: 0
        },

    },
        xAxis: {
            categories: ['0', '1', '2', '3', '4'],
        },
        series: [{
            data: [0,3,2,5] 
        }]
    });
});​

http://jsfiddle.net/jMcfG/5/

For x-axis this is not possible with use of an API. You will need to do some custom programming. It's a feture that centers graph if categories are present.

score:0

I did find an alternative solution which is to add an imaginary point which mirrors the first plot and then set the x axis min to 1 to cut it out, so the graph will cross the origin and will only be visible on the positive side. http://jsfiddle.net/jMcfG/7/

$(function () {
var chart = new Highcharts.Chart({
    chart: {
        renderTo: 'container'
    },
    xAxis: {
        min: 1,
        categories: ['-13', '0', '1', '2', '3', '4']
    },
    yAxis: {
        min: 0,
        minPadding: 1
    },

    series: [{
        data: [-1,1,3,2,5]        
    }]
});

});​


Related Articles