I am creating a chart with annotation.
I want the annotations to use a full line, so I am adding "annotation: {3: {style: 'line'}}" to my chart options.
This worked fine with the DataTable structure, but when I use JSON (which is how my data is structured) the annotation simply disappears.
If I remove the style from the chart options then the annotation reappears but is attached to one of the lines which is not what I want.
var chartData = "{cols:["
chartData += "{id:'Date',label:'Date',type:'string',pattern:''},";
chartData += "{id:'aaa',label:'aaa',type:'number',pattern:''},";
chartData += "{id:'',label:'',pattern:'',type:'string',p:{role:'annotation'}},";
chartData += "{id:'',label:'',pattern:'',type:'string',p:{role:'annotationText'}}],";
chartData += "rows:[";
chartData += "{c:[{v:'2012-01-18'},{v:200},{v:'ann'},{v:'annText'}]},";
chartData += "{c:[{v:'2012-01-19'},{v:300}]}]}";
chartData = eval("("+chartData+")"); //Convert chart data str to json
var data = new google.visualization.DataTable(chartData);
data.setValue(1, 2, 'ann2');
data.setValue(1, 3, 'ann2Text');
// Create and draw the visualization.
var ac = new google.visualization.ComboChart(document.getElementById('visualization'));
ac.draw(data, {annotation: {3: {style: 'line'}}});
Can you please help me figure out if I'm doing something wrong or perhaps this is a bug in the API?
Amir.