Hello,
I'd like to make a ComboChart with intervals. It seems that to define data
types such as required for interval role, one must use the long-handed
notation for DataTable rather than the convenient short-handed notation of
arrayToDataTable.
However, I haven't found any examples anywhere for this, nor have I found
any ComboChart with multiple columns examples using DataTable. I suppose
I don't know how to add multiple data sets to a combochart using DataTable.
Thank you in advance for your assistance.
Here's what I have:
*1) ComboChart with multiple data sets but no interval*
function drawVisualization() {
// Create and populate the data table.
var data = google.visualization.arrayToDataTable([
['Subtest', 'Alpha', 'Beta', 'Gamma'],
['Foo', 100, 938, 522],
['Bar', 135, 1120, 599],
['Qux', 157, 1167, 587]
]);
var options = {
title : 'Scores',
width: 600,
height: 400,
vAxis: {title: "SCORE"},
hAxis: {title: "Benchmark"},
seriesType: "bars"
};
// Create and draw the visualization.
var ac = new google.visualization.ComboChart(document.getElementById(
'visualization'));
ac.draw(data, options);
}
*2) ComboChart with a single data set and with intervals*
function drawVisualization() {
// Create and populate the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Subtest');
data.addColumn('number', 'Alpha');
data.addColumn({type: 'number', role: 'interval'}, 'min');
data.addColumn({type: 'number', role: 'interval'}, 'max');
data.addRows([
['Foo',500, 400, 600],
['Bar',750, 500, 1000]
]);
var options = {
title : 'Scores',
width: 600,
height: 400,
vAxis: {title: "SCORE"},
hAxis: {title: "Benchmark"},
seriesType: "bars"
};
// Create and draw the visualization, using style options.
var ac = new google.visualization.ComboChart(document.
getElementById('combochart'));
ac.draw(data, options);
}
--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.