Ahh, I see now.  I had thought that your data was already organized by data 
series.  To split the data into series based on a column of values, there 
are two basic ways.  First, you can continue along the path you started, 
filtering your data, splitting it into series, and then grouping it for 
display (http://jsfiddle.net/asgallant/2c1djqu9/5/), but this is not 
particularly efficient, as you have to filter a potentially large DataTable 
and then group your data every single time the filter changes.  Generally 
speaking, a more efficient, less computationally expensive way of doing it 
is to split your base data into multiple series and group right up front. 
 You can then use this grouped data as the basis of your charts, and follow 
my example for using a CategoryFilter as a column selector.  Here's an 
example using your code as a 
base: http://jsfiddle.net/asgallant/2c1djqu9/8/.

On Monday, October 27, 2014 11:36:32 AM UTC-4, ma wrote:
>
> Thank you for your reply.  
>
> Apology for not making query clearer.  I am trying to create a 
> multi-series line chart, which is triggered by selecting one or more names, 
> from the category filter control.  The line chart should, create a 
> multi-series, when one or more 'name' column is selected from the category 
> filter control. 
>
> I was originally using the above example, to design this functionality. 
>  So far, I am able to select multiple name's values, from the category 
> filter control, from the function below, *however its failing to create 
> line chart for the selected 'name' values from the category filter control.*
>
> Is function still plausible? if so, how can I setup my function below 
> further, so it can, render multi-line graph, from the select multiple 
> name's values (category filter control). 
>
>       google.visualization.events.addListener(control, 'statechange', 
> function () {
>                 var filteredData = control.getState();
>      
>                 // get a list of all the labels in column 0
>                 var group = filteredData.getDistinctValues(0);
>
>
>                 for (var i = 0; i < state.selectedValues.length; i++) {
>                     row = columnsTable.getFilteredRows([{ column: 1, 
> value: state.selectedValues[i] }])[0];
>                     view.columns.push(columnsTable.getValue(row, 0));
>                 }
>               
>                 var view = new google.visualization.DataView(filteredData);
>                 view.setColumns(columns);
>                 var groupedData = google.visualization.data.group(view, 
> [0], groupColumns);
>
>                 line.setView({ columns: viewColumns });
>                 line.setDataTable(groupedData);
>                 line.draw();
>             });
>
> The rest of code and can be found here (for further reference):  
> http://jsfiddle.net/miss/2c1djqu9/3/
>
> Any advice/hint would be much appreciated. Many thanks.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to