Line annotations are only supported on the domain and not on a specific series, as written here: http://code.google.com/apis/chart/interactive/docs/roles.html#annotationrole If you would move these two columns to be right after the first date column, it should be ok.
Viz Kid On Wed, Feb 8, 2012 at 1:37 PM, Amir Miller <[email protected]> wrote: > Hi, > > 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. > Here is my code: > 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? > > Thanks, > > Amir. > > -- > You received this message because you are subscribed to the Google Groups > "Google Visualization API" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/google-visualization-api/-/Qah02Y0-BDkJ. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-visualization-api?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
