Open orwant opened 9 years ago
This is driving me nuts. Is it possible at all or is it a dead end?
The docs on annotations.boxStyle say "For charts that support annotations" and in the
same box "This option is currently supported for area, bar, column, combo, line, and
scatter charts". So scatter plot explicitly supports the styling of annotations but
not annotations themselves?
Original issue reported on code.google.com by kallumburgin
on 2014-03-15 21:00:45
I have the same problem. It seems like one can style and add some annotations, but they
aren't visible in Scatter Charts
Original issue reported on code.google.com by nemethalkor
on 2014-04-14 23:05:59
The workaround is to use a Line Chart with no line and big points:
var chartOptions = {
annotation: { 0: {style: 'letter'}},
annotations: {
textStyle: {
auraColor: '#ccc',
bold: true,
color: '#000',
fontSize: 10,
opacity: 0.3
}
},
displayAnnotations: true,
legend: 'none',
lineWidth: 0,
pointSize: 5,
};
var chart = new google.visualization.LineChart(document.getElementById('chartWrapper'));
chart.draw(data, chartOptions);
I hope that helps, it's really silly that this workaround needs to be done, but there
it is :/
Original issue reported on code.google.com by kallumburgin
on 2014-04-15 16:45:21
Hey, thank you for the workaround.But, I'm not sure whether this workaround would be
helpful for me. Is it right that I must have up to 31 columns in my data for 30 different
lines/points? Because each line need an own colum for the Y-Axis,right?
At the moment I am using Bubblechart as a workaround but that looks terrible.
Original issue reported on code.google.com by nemethalkor
on 2014-04-15 17:20:32
I think it depends how you define your DataTable. While trying to use the Scatter Chart
I was building the DataTable as a JS array and then converting it.
But an easier way is to just build the DataTable:
$data = new google.visualization.DataTable();
$data.addColumn('number', 'SomeLabelX');
$data.addColumn('number', 'SomeLabelY');
$data.addColumn({type:'string', role:'annotation'});
// $data.addColumn({type:'string', role:'annotationText', p:{html:true}});
// Add more columns for tooltips and stuff
$.each(someData, function(key, value) {
$row = [];
$row.push(value.theX);
$row.push(value.theY);
$row.push(value.theAnnoation);
// $row.push(value.ThePopupAnnotationText);
// Any extra data can go here
$data.addRow($row);
}
var chartOptions = {...}
var chart = new google.visualization.LineChart(document.getElementById('chartWrapper'));
chart.draw($data, chartOptions);
So there are the x and y columns, as well as two to make the annotation, but there
can be as many rows as you want
Original issue reported on code.google.com by kallumburgin
on 2014-04-15 17:29:12
Thank you for the explanation. Nomw I get it.
Original issue reported on code.google.com by nemethalkor
on 2014-04-15 19:08:02
Original issue reported on code.google.com by
csantos.pti
on 2013-11-26 10:08:43