I have the following code and it appears fine to me, but when I run it, I 
get the error message *"Cannot call overloaded constructor setDataTable 
with parameters (object) because there is more than one matching 
constructor signature: interface DashboardPanelBuilder 
setDataTable(DataTableBuilder) interface DashboardPanelBuilder 
setDataTable(DataTableSource) (line 23, file "Code")." *

Can someone identify the problem?

function doGet() {
  var sss = 
SpreadsheetApp.openById('1DwJ608d0e7HloyYKC-MpClb46tLHvZfXUL57RvX_1d4'); 
//replace with source ID
  var ss = sss.getSheetByName('Sheet1'); //replace with source Sheet tab 
name
  var range = ss.getRange('A1:I17'); //assign the range you want to copy
  var data = range.getValues();

  var ageFilter = Charts.newNumberRangeFilter()
      .setFilterColumnLabel("Age")
      .build();

  var genderFilter = Charts.newCategoryFilter()
      .setFilterColumnLabel("Gender")
      .build();

  var pieChart = Charts.newPieChart()
      .setDataViewDefinition(Charts.newDataViewDefinition()
                            .setColumns([2,9]))
      .build();

  var tableChart = Charts.newTableChart()
      .build();

  var dashboard = Charts.newDashboardPanel()
      .setDataTable(data)
      .bind([ageFilter, genderFilter], [pieChart, tableChart])
      .build();

  var uiApp = UiApp.createApplication();

  dashboard.add(uiApp.createVerticalPanel()
                .add(uiApp.createHorizontalPanel()
                    .add(ageFilter).add(genderFilter)
                    .setSpacing(70))
                .add(uiApp.createHorizontalPanel()
                    .add(pieChart).add(tableChart)
                    .setSpacing(10)));

  uiApp.add(dashboard);
  return uiApp;
}


-- 
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 https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/60e8fbc6-1835-4467-815c-a3e9a36f40ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • [visualization-api] Error ... 'Becca' via Google Visualization API

Reply via email to