Enable/disable controls in line charts

756 views
Skip to first unread message

Vivek More

unread,
Jan 11, 2013, 5:32:21 AM1/11/13
to google-visua...@googlegroups.com
Hi All,

I m trying to do some customization in line charts. I have 3-4 lines in single chart. I want to provide some control to enable/disable (show/hide) these lines individually. Also vAxis should auto scale based on the values of lines visible in charts.

Thanks
Vivek


asgallant

unread,
Jan 11, 2013, 2:32:29 PM1/11/13
to google-visua...@googlegroups.com
There are many different ways to do this.  As one example, here's a hack that I wrote that turns a CategoryPicker control into a data series selector: http://jsfiddle.net/asgallant/WaUu2/

Vivek More

unread,
Jan 12, 2013, 1:33:36 AM1/12/13
to google-visua...@googlegroups.com
Thanks, 

This is exactly what i was looking for.

--
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/-/z9HJeXOHM6gJ.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

Vivek More

unread,
Mar 20, 2013, 1:06:31 AM3/20/13
to google-visua...@googlegroups.com
I have a customized line chart. I have provided some check box options to hide/show lines in chart (Similar to http://jsfiddle.net/asgallant/WaUu2/)

So when I hide/disable any line, it changes color of other lines, as I am changing the order of other columns. So is there any way by which we can keep the order of columns same, so that it will not change the color of other lines when we hide some lines.

Vivek More

unread,
Mar 20, 2013, 6:22:31 AM3/20/13
to google-visua...@googlegroups.com
Also is there any way to get change in scale(vAxis.max value) when we enable/disable lines

asgallant

unread,
Mar 20, 2013, 2:52:50 PM3/20/13
to google-visua...@googlegroups.com
If you want the colors to remain consistent, you have to track which data series you are showing in the chart, and assign colors to them manually (using the series.<series index>.color option).  Similarly, you can change the vAxis.max option when you change series.
Thanks, 

To unsubscribe from this group, send email to google-visualization-api+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages