Google ビジュアライゼーションの初心者です。Google ビジュアライゼーションでダッシュボードを作成しました。私のダッシュボードには、ChartWrapper を使用して描画されたテーブルがあり、文字列フィルターを使用して列の 1 つでテーブルをフィルター処理しています。私のスクリプトがどのように見えるかを以下で確認してください
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('visualization', '1.1', {packages: ['controls']});
</script>
<script type="text/javascript">
function drawVisualization() {
// Prepare the data.
var data = google.visualization.arrayToDataTable([
['Name', 'Age'],
['Michael' , '17'],
['Elisa', '17'],
['Robert', '17'],
['John', '17'],
['Jessica', '18'],
['Aaron', '19'],
['Margareth', '17'],
['Miranda', '15']
]);
// Define a StringFilter control for the 'Name' column
var stringFilter = new google.visualization.ControlWrapper({
'controlType': 'StringFilter',
'containerId': 'control1',
'options': {
'filterColumnLabel': 'Name'
}
});
// Define a table visualization
var table = new google.visualization.ChartWrapper({
'chartType': 'Table',
'containerId': 'chart1',
'options': {'height': '13em', 'width': '20em'}
});
// Create the dashboard.
var dashboard = new google.visualization.Dashboard(document.getElementById('dashboard')).
// Configure the string filter to affect the table contents
bind(stringFilter, table).
// Draw the dashboard
draw(data);
}
google.setOnLoadCallback(drawVisualization);
</script>
しかし、人の年齢が 17 に等しくないテーブル内のすべての行を「赤」で強調表示したいと思います。誰でもこれを行うのを手伝ってください。
よろしくお願いします