Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I've got a google spreadsheet that tracks status updates to a series of projects over time. The table rows each list a particular month (01/2012) and the columns list the status change ("Ready for Peer Review"). Google line charts are based off the column title, so my line chart has a single line for each status that changes over time.

Reference Chart

I would like to include a category filter so the user can manually turn particular lines on or off. Don't care how many projects were completed? Turn that line off. The problem is Google's filters operate on the rows, not on the columns. I've tried using a dataview to select columns for display, but have not managed to get this approach to work.

Here's my code for creating the chart:

// Set up the data table for use in the status update chart  
  var dataTable = Charts.newDataTable()
  .addColumn(Charts.ColumnType.DATE,"DATE")
  for (i = 1; i<datasource[0].length ; i++)         
{dataTable.addColumn(Charts.ColumnType.NUMBER,datasource[0][i])}
  for (i=1; i<datasource.length ; i++) {dataTable.addRow(datasource[i])};  
  dataTable.build();

  //  Set up the status update line chart
  var lineChart = Charts.newLineChart()
  .setDataTable(dataTable)
  .setDataViewDefinition(setView())
  .setDimensions(1150,500)
  .setRange(0,60)
  .build();

  //  Initiate the dashboard itself, including the filter -> chart/table binding
  var dashboard = Charts.newDashboardPanel()
  .setDataTable(dataTable)
  .bind([dateFilter],[tableChart,lineChart])
  .build();
share|improve this question
    
Perhaps you can share a doc with us? –  Jacob Jan Tuinstra May 22 '13 at 17:14
    
Your using Google Apps Script for that. Please change tag accordingly. –  Jacob Jan Tuinstra May 22 '13 at 18:24
    
Please give us (me) an example data set. –  Jacob Jan Tuinstra May 29 '13 at 18:05
1  
@JacobJanTuinstra: A sample data set is already included above. That is the table included in the question. –  Lazarus May 29 '13 at 18:43
    
I thought a few columns where missing there. –  Jacob Jan Tuinstra May 29 '13 at 18:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.