I'm trying to make a BarChart with different colored bars. So far so good,
but now i would like the annotation to be black for better readability.
How do i do this? I've tried some things with series and extra column but
they weren't fruitfull.
please help :)
function drawVisualization() {
var data = google.visualization.arrayToDataTable([
['color', 'avg', { role: 'style' }],
['red', 3.4 , '#BF3069'],
['red', 2.6 , '#DA94A6'],
['green', 3, '#30BF69'],
['green', 4, '#94CAA6'],
['purple', 3, '#9E30BF'],
['purple', 3, '#B894CA'],
['yellow', 4, '#cebf30'],
['yellow', 3, '#D0CA94'],
['blue', 4.415, '#3069BF'],
['blue', 2.2, '#94A6CA'],
['brown', 3, '#9A6654'],
['brown', 4, '#BA9482'],
['teal', 3, '#30B1BF'],
['teal', 3.113, '#A4D0DA'],
['all', 3, '#333333'],
['all', 4, '#666666'],
['grey', 5.231, '#CCCCCC'], ]);
var formatter = new google.visualization.NumberFormat( { pattern:'#.##' });
formatter.format(data, 1);
var view = new google.visualization.DataView(data);
view.setColumns( [0, 1, { calc: "stringify",
sourceColumn: 1,
type: "string",
role: "annotation" }, 2] );
var options = {
width: 280, height: 180,
chartArea: { top: 20, left: 10, width: "90%", height: "80%" },
title:"Attack Defense Dice Roll Averages",
bar: {groupWidth: "80%"},
vAxis: {textPosition: "none"},
tooltip:{trigger:"none"},
hAxis: {ticks: [{v:2.5, f:"2.5"}, {v:3.5 , f:"3.5"}, {v:4.5,f:"4.5"} ],
minValue:2.5,
maxValue:4.5,
minorGridlines:{count:1} } ,
};
var chart = new
google.visualization.BarChart(document.getElementById('visualization'));
chart.draw(view, 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.
For more options, visit https://groups.google.com/groups/opt_out.