Sorry to resurrect an old thread, but I'm trying to accomplish this as well. I need a discrete axis because I need to use a stepped area chart, which requires a discrete axis (rather than simply being able to say this value remains until the next data point on a continuous axis). But I also need vertical dividers at certain points - specifically, in my case, the graph shows days of the week (Sunday, Monday, etc), and I want a vertical line between the days.
Following this suggestion, I added an annotation column:
data.addColumn({type:'string',role:'annotation'});
and populated it either with a string (just using a space didn't appear to work) or null. This had the effect of giving me short little lines at the bottom of my graph, in the proper locations, with the string as a label. Ok, good start, but now I need to extend the line vertically to cover the entire graph. The documentation has a passing reference to this:
You can specify the line style by setting this chart option: annotation: {'column_id': {style: 'line'}}
However, adding the following to my options didn't appear to have any effect:
annotation:{
2:{style:'line'}
}
Of course, I have no idea if 2 is even the proper value for column id - it is column 2, assuming 0 based numbering, starting from the first data column (I have the X axis column, two data columns, and then this "annotation" column).
Any additional hints as to how to make this work? Thanks.