I'm trying to find a way to use multiple category filters to display filtered views of a data table in line chart form. The data is a table with time series columns representing different categories/subcategories, some of which are dollar amounts and some are ratios of these amounts (expressed as percentages).
My approach has been to adapt Andrew Gallant's code converting data columns into rows and using the dashboards to filter that from an initial default state. Because I need to be able to display dollar and percentage quantities in the same chart container, I have to apply two formatting routines 1) a NumberFormat rule applied to the data table, which gets the tooltip quantities right, and 2) Two chart wrappers with vAxis formats for dollars and percentages respectively. I then use a setView function to draw chart1 or chart2 depending on an if/else test for data type.
The problem is that while this works for the initial default state (say chart1) and for the first time the dashboard control changes the data type (displaying chart2), it doesn't allow the user to make any changes subsequently. This is the case even though I have checked that the computer is correctly performing the if/else test and therefore is trying to execute the correct chart display every time there is a control event.
I am mystified why the Google Visualization API won't let me draw a chart more than twice. The only way out I can see is to have separate <div>'s for each chart but I don't want to do that. Perhaps there is a fundamentally better way of approaching this problem within the framework you provide.