Hi,
I have created a dashboard watching this Google developers video
<https://www.youtube.com/watch?v=3deomYqHKgA>. After creating it I came to
know that it's deprecated. However the dashboard is rendering but I need a
little help.
There are multiple rows with same label with different data. When the chart
renders, I'm seeing same labels more than once with the corresponding data.
But what I want is one label and the sum of the data for that label.
I have attached the screenshot. Here is the code:
function doGet() {
var ss =
SpreadsheetApp.openById('1UzJ20BcH3DaFMeW-gr4wazidqhOtEWCMGEgYTu7-0CI');
var data = ss.getDataRange();
var countryFilter = Charts.newCategoryFilter()
.setAllowMultiple(true)
.setFilterColumnIndex(7)
.setSortValues(true)
.setLabelStacking(Charts.Orientation.VERTICAL)
.setCaption('Choose County')
.build();
var pieChart = Charts.newPieChart()
.setDataViewDefinition(Charts.newDataViewDefinition().setColumns([7,8]))
.setDimensions(600, 500)
.set3D()
.build();
var tableChart = Charts.newTableChart()
.setDataViewDefinition(Charts.newDataViewDefinition().setColumns([7,8]))
.build();
var dashboard = Charts.newDashboardPanel()
.setDataTable(data)
.bind([ countryFilter], [pieChart, tableChart,])
.build();
var app = UiApp.createApplication();
var filterPanel = app.createVerticalPanel();
var chartPanel = app.createHorizontalPanel();
filterPanel.add(countryFilter).setSpacing(10);
chartPanel.add(pieChart).add(tableChart).setSpacing(10);
dashboard.add(app.createVerticalPanel().add(filterPanel).add(chartPanel));
app.add(dashboard);
return app;
}
Tried searching old posts but couldn't find what I want. Any help would be
much appreciated.
Thanks,
Kesava
--
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/cce4c31a-8e71-443a-a639-09945a1fc44e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.