google.visualization.DataTable을 사용하고 있는데 두 개의 관련 열이 있는데 colSmall 및 colLarge라고합니다. 주어진 행에서 colSmall이 colLarge보다 큰 경우 해당 행의 배경색을 빨간색으로 만들고 싶습니다.두 열을 비교하여 색상 행 Google 시각화 DataTable
가장 가까운 것은 google.visualization.ColorFormat()을 사용하는 것입니다. 저는 formatter와 addRange를 만들 수 있습니다. 특정 값을 하드 코딩하는 데 사용할 수 있으므로 colSmall이 해당 값을 초과하면 빨강이됩니다 (아래 참조).
var formatter = new google.visualization.ColorFormat();
formatter.addRange('100', null, 'black', 'red'); // anything greater than 100 will be red (the quotes are because these are string values)
formatter.format(data, 7); // colSmall is index 7
이 행의 다른 열을 볼 수있는 방법을 찾을 수 없습니다. 내가 가지고있는 또 다른 문제는 이것이 전체 행보다는 셀을 빨간색으로 만 만든다는 것입니다.
는 [이 답변 (http://stackoverflow.com/a/36949638/5090771)'ColorFormat' 대 전체 행을 포함한 3 실시 예를 포함 볼 ... – WhiteHat
API가 여기 될 수 HTTPS : // developers.google.com/chart/interactive/docs/reference#colorformat –