2011-12-13 11 views
9

Estoy usando HighCharts para mostrar algunos datos estadísticos, pero tengo un problema que cuando los valores del eje x aumentan, reduce los valores. Adjunto una captura de pantalla.¿Cómo aumentar la altura de Highchart?

enter image description here

+0

tiene usted algún código jsFiddle para compartir? –

Respuesta

1

Algo como esto funcionaría:

 
var height = //get containers original height 

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

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

12

Hay un método de API para establecer el tamaño de la tabla, que se encuentra en el objeto gráfico y setSize llamada. chart.setSize(width, height) vea esto example on jsfiddle y reference.

+1

No tengo idea de cómo me perdí ese método ... gracias por ahorrarme algo de tiempo. – AlexMA

+0

ACTUALIZADO setSize() REFERENCIA: http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/members/chart-setsize-button/ –

12

Debe añadir marginBottom:

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

cualquier forma de agregar + 20px al margen? es decir, lea cuál es el margen y añada 20 píxeles – idrinkpabst

Cuestiones relacionadas