I have two chart (*Piechart and Linechart*) that they receive their data
from on dashboard (*arrayToDataTable*), for pie chart i want to get a query
on Column "ville" and "Age" group by "ville" but i don't know how i can do
it. ( SELECT SUM("Age"), ville FROM "*arrayToDataTable*" GROUP BY ville ).
*!function($) {*
* google.load('visualization', '1.1', {packages: ['controls']});*
* function drawVisualization() {*
* // Prepare the data*
* var data = google.visualization.arrayToDataTable([*
* ['Name', 'Age', 'date', 'ville'],*
* ['Michael' , 12, 2012, 'A'],*
* ['Elisa', 20, 2013, 'B'],*
* ['Robert', 7, 2014, 'A'],*
* ['John', 54, 2015, 'A'],*
* ['Jessica', 22, 2016, 'E'],*
* ['Aaron', 3, 2017, 'F'],*
* ['Margareth', 42, 2018, 'G'],*
* ['Miranda', 33, 2019, 'H']*
* ]);*
* var control = new google.visualization.ControlWrapper({*
* 'controlType': 'ChartRangeFilter',*
* 'containerId': 'control',*
* 'options': {*
* // Filter by the date axis.*
* 'filterColumnIndex': 2,*
* 'ui': {*
* 'chartType': 'LineChart',*
* 'chartOptions': {*
* 'chartArea': {'width': '90%'},*
* 'hAxis': {'baselineColor': 'none'}*
* },*
* // Display a single series that shows the closing value of
the stock.*
* // Thus, this view has two columns: the date (axis) and the
stock value (line series).*
* 'chartView': {*
* 'columns': [2,1]*
* },*
* *
* }*
* },*
* //Initial range: 2010 to 2021*
* 'state': {'range': {'start': new Date(2012), 'end': new
Date(2019)}}*
* })*
* // Define a bar chart*
* var barChart = new google.visualization.ChartWrapper({*
* 'chartType': 'BarChart',*
* 'containerId': 'chart1',*
* 'options': {*
* 'width': 400,*
* 'height': 300,*
* 'hAxis': {'minValue': 0, 'maxValue': 60},*
* 'chartArea': {top: 0, right: 0, bottom: 0},*
* },*
* 'view': {'columns': [0, 1]}*
* });*
* // Define a pie chart*
* var pieChart = new google.visualization.ChartWrapper({*
* 'chartType': 'PieChart',*
* 'containerId': 'chart2',*
* 'options': {*
* 'width': 600,*
* 'height': 300,*
* //'legend': 'bottom',*
* 'chartArea': {'left': 5, 'top': 5, 'right': 5, 'bottom': 5},*
* 'pieSliceText': 'value'*
* },*
* 'view': {'columns': [3, 1]}*
* });*
* // Create the dashboard.*
* var dashboard = new
google.visualization.Dashboard(document.getElementById('dashboard')).*
* // Configure the slider to affect the bar chart*
* *
* *
* bind(control, barChart).*
* bind(control, pieChart).*
* *
* // Draw the dashboard*
* draw(data);*
* }*
* google.setOnLoadCallback(drawVisualization); *
**
*}(jQuery);*
--
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/groups/opt_out.