Shahrukh A.
Shahrukh A.

Reputation: 1101

How to increase the height of highchart?

I am using HighCharts for displaying some statistical data but i have a problem that when values of x axis increases, it cuts down the values. I am attaching screenshot.

enter image description here

Upvotes: 9

Views: 20337

Answers (3)

July
July

Reputation: 136

You should add marginBottom:

chart = new Highcharts.Chart({
            chart: {
                renderTo: 'container',
                type: 'column',
                marginRight: 130,
                marginBottom: 70 /* HERE */
            },
            title: {
                text: '@Model.Title',
                x: -20 
            }

Upvotes: 12

eolsson
eolsson

Reputation: 12727

There's an API method to set the size of the chart, found on the chart object and called setSize. chart.setSize(width, height) see this example on jsfiddle and the reference.

Upvotes: 12

Sudhir Bastakoti
Sudhir Bastakoti

Reputation: 100175

Something like this would work:

var height = //get containers original height

var new_height = height + (data.length * 10);

$("#highcharts-0").css("{height:"+new_height+"}");

Upvotes: 1

Related Questions