Open orwant opened 9 years ago
Hello,
I have customized a combo chart with candlestics and and hidden lines(with points)
for creating a box-alike chart. Here you can see candlesticks and 2 lines for (median
and mean).
I hope it helps you!
function drawVisualization() {
// Create and populate the data table. Column 6: median, Column 7: mean. Values are
invented!
var data = google.visualization.arrayToDataTable([
['Serie1', 20, 28, 38, 45, 20, 25],
['Serie2', 31, 38, 55, 66, 30, 35],
['Serie3', 50, 55, 77, 80, 10, 15],
['Serie4', 77, 77, 66, 50, 20, 25],
['Serie5', 68, 66, 22, 15, 30, 35]
// Treat first row as data as well.
], true);
// Create and draw the visualization.
var ac = new google.visualization.ComboChart(document.getElementById('visualization'));
ac.draw(data, {
title : 'Box Plot with Median and Average',
width: 600,
height: 400,
vAxis: {title: "Value"},
hAxis: {title: "Serie ID"},
series: { 0: {type: "candlesticks"}, 1: {type: "line", pointSize: 10, lineWidth:
0 }, 2: {type: "line", pointSize: 10, lineWidth: 0, color: 'black' } }
});
}
Original issue reported on code.google.com by manuelpalacin
on 2013-04-18 11:10:22
Now with legend titles:
******************************
function drawVisualization() {
// Create and populate the data table.
var data = google.visualization.arrayToDataTable([
['ID', 'IQR', '', '', '', 'Median', 'Average'],
['Serie1', 20, 28, 38, 45, 20, 25],
['Serie2', 31, 38, 55, 66, 30, 35],
['Serie3', 50, 55, 77, 80, 10, 15],
['Serie4', 77, 77, 66, 50, 20, 25],
['Serie5', 68, 66, 22, 15, 30, 35]
// Treat first row as data as well.
]);
// Create and draw the visualization.
var ac = new google.visualization.ComboChart(document.getElementById('visualization'));
ac.draw(data, {
title : 'Box Plot with Median and Average',
width: 600,
height: 400,
vAxis: {title: "Value"},
hAxis: {title: "Serie ID"},
series: { 0: {type: "candlesticks"}, 1: {type: "line", pointSize: 10, lineWidth:
0 }, 2: {type: "line", pointSize: 10, lineWidth: 0, color: 'black' } }
});
}
Original issue reported on code.google.com by manuelpalacin
on 2013-04-18 12:09:56
Now with legend titles: ****************************** function drawVisualization() { // Create and populate the data table. var data = google.visualization.arrayToDataTable([ ['ID', 'IQR', '', '', '', 'Median', 'Average'], ['Serie1', 20, 28, 38, 45, 20, 25], ['Serie2', 31, 38, 55, 66, 30, 35], ['Serie3', 50, 55, 77, 80, 10, 15], ['Serie4', 77, 77, 66, 50, 20, 25], ['Serie5', 68, 66, 22, 15, 30, 35] // Treat first row as data as well. ]); // Create and draw the visualization. var ac = new google.visualization.ComboChart(document.getElementById('visualization')); ac.draw(data, { title : 'Box Plot with Median and Average', width: 600, height: 400, vAxis: {title: "Value"}, hAxis: {title: "Serie ID"}, series: { 0: {type: "candlesticks"}, 1: {type: "line", pointSize: 10, lineWidth: 0 }, 2: {type: "line", pointSize: 10, lineWidth: 0, color: 'black' } } }); }
Original issue reported on code.google.com by
manuelpalacin
on 2013-04-18 12:09:56
how to plot this chart horizontally
Original issue reported on code.google.com by
yimmieg
on 2012-01-10 19:28:11