4
我是新來的Stackoverflow和谷歌圖表。Google Charts傳說重疊
我在使用google圖表API的項目中遇到了一個問題,我正在繪製兩個圖例,但它們在預覽時重疊。
我在stackoverflow和jsfiddle上嘗試過各種解決方案,但都沒有工作。
下面是一些我的代碼段,並輸出:
配置對象圖:
var options = {
hAxis : {
title : xAxis,
textStyle:{
color: 'black',
fontSize : '8px'
},
slantedText : true,
slantedTextAngle : 90,
titleTextStyle : {
fontSize : '15px',
italic : false
},
},
vAxis : {
title : yAxis,
format:format,
textStyle:{
color: 'black',
fontSize : '8px'
},
titleTextStyle : {
fontSize : '15px',
italic : false
},
viewWindowMode : 'explicit',
viewWindow : {
min : 0,
//max: 1200000
}
},
backgroundColor : 'transparent',
interpolateNulls: false,
width : 350,
height : 180,
chartArea : {
left : 40,
width : '45%',
height : '45%'
},
legend: {
position: 'top',
maxLines: 3,
},
series : {
0 : {
color : line1Color,
visibleInLegend : true,
pointShape: 'square',
pointSize: 10,
},
1 : {
color : line2Color,
visibleInLegend : true,
pointShape: 'diamond',
pointSize: 10,
}
}
};
輸出: https://snag.gy/Yd2qjX.jpg
thanx您的答案,但它並沒有爲我工作。我試圖設置寬度和字體大小,但它仍然重疊。可能是內部的CSS問題。 – maxbee
它需要幾次嘗試才能使上面的工作,它可能是值得建立自己的傳奇在一個相鄰的'div' - [這裏是一個例子](http://stackoverflow.com/a/36064828/5090771) – WhiteHat
是的,謝謝我明白了 – maxbee