How do I rotate my HighCharts bar chart so its vertical, not horizontal?

John Zumbrum picture John Zumbrum · Jun 27, 2012 · Viewed 28.8k times · Source

enter image description here

$(document).ready(function() {
chart1 = new Highcharts.Chart({
    chart: {
        renderTo: 'QueryResultsChart',
        type: 'bar'
    },
    title: {
        text: 'Production History'
    },
    xAxis: {
        title: {
            text: 'Production Day'
        },
        type: 'datetime'
    },
    yAxis: {
        title: {
            text: 'Gross Production'
        }
    },
    series: [{
        name: 'Data',
        data: []
    }]
});
chart1.series[0].setData(". json_encode($aChartData) .");
});

The data is there an correct, it's just showing my xAxis on the yAxis for some reason...

Answer

Moin Zaman picture Moin Zaman · Jun 28, 2012

Vertical bar charts are called column's in Highchart.

Change this:

type: 'column' //was 'bar' previously`

See example here: http://jsfiddle.net/aznBb/