Annotation Charts

21 views
Skip to first unread message

Joshua Herman

unread,
Sep 14, 2018, 1:04:09 PM9/14/18
to Google Visualization API
Hello!

I'm looking for guidance on how to create a google annotation chart where I can add lines dynamically. Specifically, I have the following webpage (which you should be able to open in a text editor or a web browser) which contains just one google annotation chart (this is derived from a larger website, but the rest of the page isn't important, so I've isolated just the chart so that you can compile it and see what's happening).

At the moment, the chart pulls from a google doc that contains exactly one series.

I want to add more series to this chart, but I don't want them to always be displayed. Specifically, the current line is plotting a global series, and I want to have maybe 20 country-specific series. I would want to make a button for each country, and then the person viewing the page would start by seeing just the global series, but could simply click the buttons and have the country-specific series overlay the global series in a different color (they could add as many as they want). How can I do this? Do I put the other series in the same google doc? How can I make them only be displayed conditional on the pressing of a button? Any explicit code alterations would be appreciated, as well as any general suggestions about how to handle conditional series with google annotation charts (or any other advice about other ways to approach this problem).

Thank you for your help,
Joshua
charts_test.htm
Reply all
Reply to author
Forward
0 new messages