How to have multiple-line annotations in Google Visualization API?
google-visualization
Solution
Add `p': {'html': true}}` to your tooltip like this
data.addColumn({type:'string', role:'tooltip','p': {'html': true}});
then your add `<br/>` to your tooltip content
Problem
I'm attempting to generate an annotated LineChart using the google visualization API, and while I have it working, I would like to be able to have annotations have line-breaks if possible. Unfortunately, it seems like Google's API ignores any newline information and displays everything on a single line. Has anyone come up with a way around this? Here's an example: ``` var data = new google.visualization.DataTable(); data.addColumn('string', 'Month'); data.addColumn('number', 'Sales'); data.addColumn({type:'string', role:'annotation'}); data.addColumn({type:'string', role:'annotationText'}); data.addRows([ ['April',1000, 'A', "Stolen data\nSo-so month"], ['May', 1170, 'B', "Coffee spill\nAnother line\nA third line"], ['June', 660, 'C', "Wumpus attack"] ]); ``` I've tried `\n, \\n, and <br />` and those aren't working.