[php] 구글 차트 배경색 및 가로, 세로 축 텍스트 색상 바꾸기
참고 자료
배경색
https://stackoverflow.com/questions/8808100/google-chart-background-color
Google Chart Background Color
I'm styling a google chart using the javascript api. I want to change the background of the area where the data is plotted. For some reason when I set background options like so: chart.draw(data, {
stackoverflow.com
텍스트
https://stackoverflow.com/questions/26406307/google-charts-change-axis-text-color
Google charts - change axis text color
I'm trying to create a black chart with Google Charts, but I can't seem to change the text color of the axis. I tried some code pieces I found on the web, like: hAxis: { color: '#FFF' } But it ...
stackoverflow.com
var options = {
chartArea: {
backgroundColor: {
fill: '#464646',
},
},
backgroundColor: {
fill: '#464646',
},
hAxis: {
title: '가로축',
textStyle:{
color: '#FFF'
}
},
vAxis: {
title: '세로축',
textStyle:{
color: '#FFF'
}
},
}
구글 차트 내 이렇게 구성하면 배경색이 바뀐다. 여기서 끝나면 좋았을 것을...
이렇게 만들었더니 가로, 세로축 서브타이틀 색상이 안바뀐다...
왜냐 했더니 타이틀 속성은 따로 있던 것.
var options = {
chartArea: {
backgroundColor: {
fill: '#464646',
},
},
backgroundColor: {
fill: '#464646',
},
hAxis: {
title: '가로축',
titleTextStyle: {
color: '#FFF'
},
textStyle:{
color: '#FFF'
}
},
vAxis: {
title: '세로축',
titleTextStyle: {
color: '#FFF'
},
textStyle:{
color: '#FFF'
}
},
legend: {
textStyle: {
color: '#ffffff'
}
},
}
적용 예시
https://jsfiddle.net/rtw1xhko/
Edit fiddle - JSFiddle - Code Playground
jsfiddle.net