Hello, below is my chart "example 1" that I would like use Legends
directly below each bar just like the words "Excelent, Good, Average,
Poor" in "example 2".
I have noticed a few post for people asking this but they find it hard
to explain...The problem is that my code uses "Google Chart Tools"
rather than the standard graph format, that can do such a thing,
simply by using the comand &chdl=Excelen|Good|Average|Poor.
So what I need is a way to do the same with chart tools.
Example 1
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data5 = new google.visualization.DataTable();
data5.addColumn('number', 'Your Data');
data5.addColumn('number', 'Your Industry');
data5.addColumn('number', 'All Organisation');
data5.addRows(1);
data5.setValue(0, 0,22);
data5.setValue(0, 1, 33);
data5.setValue(0, 2, 55);
var chart5 = new
google.visualization.ColumnChart(document.getElementById('chart5'));
chart5.draw(data5, {
width: 500,
height: 350,
titlePosition: 'none',
legend: 'bottom',
colors:['c7dcf2','0082c8','377aba'],
vAxis: {title: 'Percentage (%)',
titleTextStyle: {color: 'black',fontName:'Arial',fontSize:18},
maxValue: 100,
minValue: 0
}
});
}
</script>
Example 2:
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data1 = new google.visualization.DataTable();
data1.addColumn('string', '');
data1.addColumn('number', 'Your Data');
data1.addColumn('number', 'Your Industry');
data1.addColumn('number', 'All Organisation');
data1.addRows(4);
data1.setValue(0, 0, 'Excelent');
data1.setValue(0, 1, 33);
data1.setValue(0, 2, 22);
data1.setValue(0, 3, 11);
data1.setValue(1, 0, 'Good');
data1.setValue(1, 1, 44);
data1.setValue(1, 2, 88>);
data1.setValue(1, 3, 43);
data1.setValue(2, 0, 'Average');
data1.setValue(2, 1, 76);
data1.setValue(2, 2, 21);
data1.setValue(2, 3, 64);
data1.setValue(3, 0, 'Poor');
data1.setValue(3, 1, 98);
data1.setValue(3, 2, 35);
data1.setValue(3, 3, 24>);
var chart1 = new
google.visualization.ColumnChart(document.getElementById('chart1'));
chart1.draw(data1, {
width: 500,
height: 350,
titlePosition: 'none',
legend: 'none',
colors:['c7dcf2','0082c8','377aba'],
colors:['green','F60','377aba'],
vAxis: {title: 'Percentage (%)',
titleTextStyle: {color: 'black',fontName:'Arial',fontSize:18},
maxValue: 100,
minValue: 0
}
})
}
</script>
http://code.google.com/apis/chart/interactive/docs/gallery/columnchart.html