Hello,
with the following source code I draw a dashboard with a chart range filter
and a area chart.
var dashboard = new google.visualization.Dashboard($element[0]);
var control = new google.visualization.ControlWrapper({
'controlType': 'ChartRangeFilter',
'containerId': 'control',
'options': {
// Filter by the date axis.
'filterColumnIndex': 0,
'ui': {
'chartType': 'LineChart',
'chartOptions': {
'chartArea': {'width': '80%'},
'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': [0, 1]
},
'minRangeSize': 50
}
},
// Initial range: 2012-02-09 to 2012-03-20.
// This must be read from record data
//'state': {'range': {'start': new Date(2012, 1,
9), 'end': new Date(2012, 2, 20)}}
'state': {'range': {'start': 0, 'end': 500}}
});
var chart = new google.visualization.ChartWrapper({
'chartType': 'AreaChart',
'containerId': 'chart',
'options': {
// Use the same chart area width as the control
for axis alignment.
'chartArea': {'height': '80%', 'width': '80%'},
'hAxis': {'slantedText': false},
'vAxis': {'viewWindow': {'min': 0, 'max':
10000}},
'legend': {'position': 'in'}
},
"view": {"columns": [0,1,2]}
/*,
// Convert the first column from 'date' to
'string'.
'view': {
'columns': [
{
'calc': function(dataTable, rowIndex) {
return dataTable.getFormattedValue(rowIndex, 0);
},
'type': 'string'
},
1,2,3,4]
}*/
});
var data = new google.visualization.DataTable(
analysisResult
);
dashboard.bind([control], [chart]);
dashboard.draw(data);
The JSON literal that contains the data looks like this:
{
"cols": [{
"id": "date_time_od",
"label": "Zeit in 10ms",
"type": "number"
}, {
"id": "abs_accel_id",
"label": "Betrag der Beschleunigungswerte",
"type": "number"
}, {
"id": "mean_id",
"label": "Mittelwert",
"type": "number"
}, {
"id": "variance_id",
"label": "Varianz",
"type": "number"
}
],
"rows": [{
"c": [{
"v": 0,
"f": "Zeit in 10 ms"
}, {
"v": 3640.7882225119747,
"f": "Beschleunigungswert"
}, {
"v": 3604.48,
"f": "Mittelwert"
}, {
"v": 20759.686464646464,
"f": "Varianz"
}
]
}, {
"c": [{
"v": 1,
"f": "Zeit in 10 ms"
}, {
"v": 3771.895525488376,
"f": "Beschleunigungswert"
}, {
"v": 3604.48,
"f": "Mittelwert"
}, {
"v": 20759.686464646464,
"f": "Varianz"
}
]
}
]}
Although everything is drawn as expected (in my opinion), the "one or more
participants failed to draw" error emerges.
If a remove the dashboard and control and simply draw the chart, no error
occurs. So I derived, that the error must be related to the control,
but I can not see it.
Has anybody an idea, how to solve it?
Greets,
Lisa
--
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/d/optout.