Vertical Marker on Line Chart

39,197 views
Skip to first unread message

Jim

unread,
May 16, 2012, 10:50:42 AM5/16/12
to Google Visualization API
Is it possible to add a vertical marker for a line / area chart? For
example, say my x-axis range is 0-50 and I want to show a vertical
line at 33. Is that possible? I couldn't find this in the
documentation.

asgallant

unread,
May 16, 2012, 1:47:19 PM5/16/12
to google-visua...@googlegroups.com
No, there is no support for this in Line or Area charts.  If you use scatter charts, you can make something that looks very similar to a line chart, and you can put a vertical line in that.  I helped someone else here do something similar in ScatterCharts: https://groups.google.com/d/msg/google-visualization-api/ePW6i9pb0qE/TEkjMdHGXaEJ

asgallant

unread,
May 16, 2012, 1:49:57 PM5/16/12
to google-visua...@googlegroups.com
Oh, I forgot - you can use domain-axis annotations to do this.  See column roles for details implementing these.
Message has been deleted

Luke Chi

unread,
Jul 2, 2013, 1:01:52 PM7/2/13
to google-visua...@googlegroups.com
i got it!



Luke Chi於 2013年7月2日星期二UTC+8下午11時13分12秒寫道:
hi, asgallant,

I can't figure out how to use domain-axis annotation to draw a vertical line, can you explan how to do that?

asgallant於 2012年5月17日星期四UTC+8上午1時49分57秒寫道:

Richard Hammitt

unread,
Jun 25, 2015, 12:04:12 PM6/25/15
to google-visua...@googlegroups.com, jnoth...@gmail.com
You may consider the use of error bars.  I carried this trick over from Excel.  

1) Add another column to your chart in Advanced Edit, Recommendations, Data Range.  
2) Add a number to a cell in that column within your Y-axis range corresponding to the location of your vertical line. 
3) In Advanced Edit, Customization, Series, pick your newly created column.   You can add an error bar for the cell you chose in 2) by going to the Error Bars and selecting Constant from the Error Bar drop down menu.
4) Extend the error bar as high and low as you want.  You can fix the Y-Axis range if your error range raises or lowers the chart Y range.

I hope this helps!

This message and any files transmitted with it are the property of Sigma-Aldrich Corporation, are confidential, and are intended solely for the use of the person or entity to whom this e-mail is addressed. If you are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, please contact the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited.

Stefan Poninghaus

unread,
Oct 13, 2016, 9:33:57 PM10/13/16
to Google Visualization API, jnoth...@gmail.com
Hi Richard,

That was a perfect solution for what I was looking for. Its also worth noting that you can use this to do horizontal lines as well, or a crosshair, through adding a trend line instead of a error bar.

Thanks

Nick Zmina

unread,
Jan 19, 2017, 8:58:07 PM1/19/17
to Google Visualization API, jnoth...@gmail.com
I'm not sure if you have already figured this out, but there is an extremely simple solution.

This page has instructions for adding an annotation which did the job for me:

Add or edit a trendline or annotation

The annotation allowed me add a note to any existing X or Y axis point.
Want to put it somewhere else?  Just add another row or column.

Hope this helps (5 yrs later)

On Wednesday, May 16, 2012 at 9:50:42 AM UTC-5, Jim wrote:

Adrian Nagle

unread,
Jun 15, 2018, 9:53:22 AM6/15/18
to Google Visualization API
Thank you for the tip.  This mostly addresses what I was looking for, similar to original poster.
Reply all
Reply to author
Forward
0 new messages