With Google Charts, it is possible to have text annotations. I however require an image to be displayed.
Here's a JS fiddle (adapted from someone else's code) showing what I'm trying to do. http://jsfiddle.net/Lgn4T/
var data = new google.visualization.DataTable();
data.addColumn('string', 'Name');
data.addColumn('number', 'Value');
data.addColumn({type: 'string', role: 'annotation'});
data.addColumn({type: 'string', role: 'annotationText'});
data.addRows([
['Foo', 53, '<img src="bar.png"> Foo text', 'Foo description'],
['Bar', 71, 'Bar text', 'Bar description'],
['Baz', 36, 'Baz text', 'Baz description'],
['Cad', 42, 'Cad text', 'Cad description'],
['Qud', 87, 'Qud text', 'Qud description'],
['Pif', 64, 'Pif text', 'Pif description']
]);
Is this possible through annotations, or by other means? I need to use the line chart, so other methods would have to take this into account.
After some experimentation, I determined that you can add images to the annotations, but only to the
annotationText
column.In order to make the HTML annotations work, you must do two things: first, set the
annotationText
column'shtml
property totrue
, and then set the chart'stooltip.isHtml
property totrue
, like this:See working example here: http://jsfiddle.net/asgallant/7w2Hz/