Error Message: Cannot call overloaded constructor setDataTable with parameters (object) because there is more than one

29 views
Skip to first unread message

Becca

unread,
Jul 26, 2017, 10:31:46 AM7/26/17
to Google Visualization API
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;
}


Daniel LaLiberte

unread,
Jul 26, 2017, 10:50:41 AM7/26/17
to Google Visualization API
It would be better to ask questions that are specific to the AppsScript API in forums for AppsScript users, since users in this forum are unlikely to know the answer. See https://developers.google.com/apps-script/support


--
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 google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
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.



--
Reply all
Reply to author
Forward
0 new messages