score:4

Accepted answer

the right way to do it is set the offset to -15.

yaxis: {
    offset: -15
}

demo

offset:

the distance in pixels from the plot area to the axis line. a positive offset moves the axis with it's line, labels and ticks away from the plot area. this is typically used when two or more axes are displayed on the same side of the plot. defaults to 0.

reference

score:1

fixed : http://jsfiddle.net/basarat/pfkbx/1/

basically need to add yaxis.align = 'left'. also move the labels up a bit (so they are on the line instead of under the line by setting the y=2 property) and also bring them into focus with x=0 property:


$(function () {
   var chart;
        $(document).ready(function () {
            chart = new highcharts.chart({
                chart: {
                    renderto: 'container',
                    spacingleft: 2,
                    spacingright: 2
                },
                credits: { enabled: false },
                title: { text: '' },
                yaxis: {
                    title: '',
                    labels: {
                        style: {
                            fontsize:'9px'
                        },
                      y:-2,
                      x:0,
                      align:'left'
                    }
                },
                xaxis: { labels: { enabled: false } }, //hide the x axis labels 

                series: [{
                    type: 'area',
                    name: 'speed',
                    showinlegend: false,
                    data: [
                        71.5, 106.4, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 95.6,
                        71.5, 106.4, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 95.6,
                        54.4]
                }],
                /* to make it pretty */
                plotoptions: {
                    area: {
                        animation: false,
                        linewidth: 1,
                        marker: {
                            enabled: false,
                            states: {
                                hover: {
                                    enabled: true,
                                    radius: 5
                                }
                            }
                        },
                        shadow: false,
                        states: {
                            hover: {
                                linewidth: 1
                            }
                        },
                        threshold: null
                    }
                }
            });
        });

});

score:2

consider using the following using your xaxis object:

        maxpadding:0,
        minpadding:0

also make sure your labels closure doesn't include a 'step'

min and max are also a handy way to bind


Related Query

More Query from same tag