1
내가 좋아하는 내 구글 막대 그래프에 라벨을 부착하기 위해 dataView로를 만들었습니다Google 차트 dataView 형식이 dataSource와 다르게 표시 되나요?
options = {
title: arr[0][0],
titleTextStyle: { fontSize: '12', color: '#666' },
colors: ['#50c0ed'],
backgroundColor: { fill: 'transparent' },
height: 220,
width: '100%',
is3D: true,
fontSize: '11',
hAxis: { format: '$###,###,###.00' },
vAxis: {
format: '$###,###,###.##',
viewWindow: {
min: 0
}
},
chartArea: { width: '100%', height: '60%', top: '40', left: '65', right: '10' },
tooltip: { textStyle: { color: '#333', fontSize: '11' } }
};
formatter = new google.visualization.NumberFormat({ pattern: '$###,###.##/SF/year' });
formatter.format(data, 1);`enter code here`
view = new google.visualization.DataView(data);
view.setColumns([0, 1,
{
calc: "stringify",
sourceColumn: 1,
type: "string",
role: "annotation",
}]);
chart = new google.visualization.ColumnChart(container[0]);
과 결과가 enter image description here입니다,하지만 난 결말/SF/년 레이블에서 제외 할하지만 여전히 계속 막대 위에 hoover 할 때 나는 dataVIew를 초기화 한 후에 만 포맷터를 설정하려고했지만이 작업은하지 않습니다. 레이블에서 SF/year를 제거 할 수는 있지만 계속 처리 할 수 있습니까?
운의 값을 포맷 대신
"stringify"
사용
formatValue
방법 맞춤calc
함수를 사용 이 질문이 있으십니까? 수락 된 것으로 표시 하시겠습니까? (투표 버튼으로 체크 표시) – WhiteHat