2012-01-17 11 views
21

Trabajar con un Google bar chart, esto es lo que tengo:Google Chart Tools truncar las etiquetas de eje y

enter image description here

Aquí mis opciones de personalización

var options = { 
    width: 500, height: 240, 
    legend : 'none', 
    vAxis:{title:'Answers',textStyle:{color: '#005500',fontSize: '12', paddingRight: '100',marginRight: '100'}}, 
    hAxis: { title: 'Percentage', textStyle: { color: '#005500', fontSize: '12', paddingRight: '100', marginRight: '100'} } 
}; 

no puedo configurar un ancho de éstos <g>/<rect> etiquetas?

Respuesta

41

Creo que la opción chartArea.left es lo que estás buscando. Pruebe algo como esto, y perder el tiempo con los valores chartArea.left y chartArea.width (debe sumar a su anchura total de 500, aunque) hasta que los Y son todos visibles las etiquetas:

var options = { 
    width: 500, height: 240, 
    legend : 'none', 
    vAxis:{title:'Answers',textStyle:{color: '#005500',fontSize: '12', paddingRight: '100',marginRight: '100'}}, 
    hAxis: { title: 'Percentage', textStyle: { color: '#005500', fontSize: '12', paddingRight: '100', marginRight: '100'} }, 
    chartArea: {left:100, width: 400} 
}; 
2

ancho ChartArea se puede ajustar en porcentaje. chartArea: {ancho: 50%}. Esto dejará hasta el 50% del ancho total del gráfico en la columna de la izquierda.

+1

asegúrese de cambiar eso a chartArea (con una 'r') –

+0

Gracias por notarlo. Corregido – flm

Cuestiones relacionadas