Jake Hargus
Jake Hargus

Reputation: 362

Highcharts: y-axis labels are missing

I've written dozens of these charts and have never had this problem. My y-axis labels aren't showing up in this particular chart:

$(function () {
$('#container').highcharts({
    chart: {
        alignTicks: false,
        animation: {
            animation: false
        },
        height: 180,
        reflow: true,
        width: 425,
        zoomType: 'x'
    },
    credits: {
        enabled: false
    },
    legend: {
        enabled: false,
        layout: 'horizontal'
    },
    plotOptions: {
        line: {
            animation: false,
            marker: {
                radius: 0
            },
            stickyTracking: false,
            turboThreshold: 5000000,
            zIndex: 1
        },
        spline: {
            animation: false,
            marker: {
                radius: 0
            },
            turboThreshold: 5000
        }
    },
    title: {
        text: ''
    },
    tooltip: {
        backgroundColor: '#303030',
        borderColor: 'white',
        borderRadius: 0,
        borderWidth: 1,
        style: {
            font: '20pt [FontFamily: Name=Microsoft Sans Serif]',
            padding: '10px',
            color: 'white'
        },
        valueDecimals: 0,
        valueSuffix: 'F'
    },
    xAxis: {
        categories: ['Wed', 'Thu', 'Fri', 'Sat', 'Sun', 'Mon', 'Tue'],
        lineColor: 'black',
        lineWidth: 2
    },
    yAxis: {
        endOnTick: false,
        gridLineWidth: 0,
        lineWidth: 2,
        maxPadding: 0,
        minPadding: 0,
        startOnTick: false,
        id: 'ForecastData',
        lineColor: 'black',
        linkedTo: 0,
        offset: 0,
        title: {
            text: ''
        },
        type: "linear"
    },
    exporting: {
        buttons: {
            exportButton: {
                enabled: false
            },
            printButton: {
                enabled: false
            }
        },
        enabled: false
    },
    series: [{
        data: [33, 31, 35, 33, 36, 37, 36],
        labelText: 'Daily Min Temperature',
        name: 'Daily Min Temperature',
        type: 'spline',
        color: '#2177E0'
    }]

});

});

http://jsfiddle.net/5QBzv/

I can't seem to figure out what I'm missing. Any ideas?

Thanks!

Upvotes: 1

Views: 2946

Answers (1)

Geo
Geo

Reputation: 3200

Try replacing your x and y axis with this

xAxis: {
        categories: ['Wed', 'Thu', 'Fri', 'Sat', 'Sun', 'Mon', 'Tue'],
        lineColor: 'black',
        lineWidth: 2
            },
yAxis: {
         title: {
                  text: 'DATA'
                },
                lineColor: 'black',
                lineWidth: 2
                 categories: ['1', '2', '3', '4', '5', '6', '7'],
            },

Or remove the linkedTo from your code.

Upvotes: 1

Related Questions