Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Finally found a way, thought there would be an easier way but maby not</p> <pre><code>// Place graph var drawChart = new google.visualization.Dashboard(document.getElementById('dashboard')).bind([compPicker], [chart, table]);; drawChart.draw(data); // Filter respondents document.getElementById('names').onchange = function(evt) { if (evt.target.selectedIndex == 0) { // Expectancy chart.setView({'columns': [0,1,2,3,4]}); chart.setOption('colors', ["#FFC000","#00b0f0","#ff0000","#92d050"]); } else if (evt.target.selectedIndex == 1) { chart.setView({'columns': [0,1]}); chart.setOption('colors', ["#FFC000"]); } else if (evt.target.selectedIndex == 2) { chart.setView({'columns': [0,2]}); chart.setOption('colors', ["#00b0f0"]); } else if (evt.target.selectedIndex == 3) { chart.setView({'columns': [0,3]}); chart.setOption('colors', ["#ff0000"]); } else if (evt.target.selectedIndex == 4) { chart.setView({'columns': [0,4]}); chart.setOption('colors', ["#92d050"]); } else { chart.setView({'columns': [0,1,2,3,4]}); chart.setOption('colors', ["#FFC000","#00b0f0","#ff0000","#92d050"]); } drawChart.draw(data); }; &lt;select id="names"&gt; &lt;option value="all"&gt;all&lt;/option&gt; &lt;option value="pete"&gt;pete&lt;/option&gt; &lt;option value="john"&gt;john&lt;/option&gt; &lt;option value="carl"&gt;carl&lt;/option&gt; &lt;option value="andrea"&gt;andrea&lt;/option&gt; &lt;/select&gt; </code></pre> <p>full code and example <a href="http://jsfiddle.net/fcqeA/1/" rel="nofollow">http://jsfiddle.net/fcqeA/1/</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload