Not exactly.  The key here is that the series doesn't actually go away 
(otherwise it wouldn't show in the legend) - I'm just replacing the values 
in the series with nulls.

On Thursday, May 16, 2013 12:52:25 AM UTC-4, [email protected] wrote:
>
> Brilliant. That's exactly what I was ineptly trying to reach on my own. 
> Thanks 150%.
>
> Just to make sure I get the logic behind what you've done... you've 
> created a columns array which you use as a key of sorts for determining 
> what goes into view. When you click on a legend element you are basically 
> removing it from the key, and therefore from the view. When you reclick the 
> legend element you are adding the series back to the key, and therefore to 
> the view. Is that a good recap?
>
> JP
>
> On Wednesday, May 15, 2013 12:02:56 PM UTC-4, asgallant wrote:
>>
>> That's an unusual effect; I'm inclined to call it a bug.
>>
>> Using 0 instead of null fixes the display issue, but then when you try to 
>> mouseover the data points of a lower series in the stack, you see a tooltip 
>> for the hidden series.  The fix for this is to use a ComboChart instead of 
>> an AreaChart.  By default, set all series to type 'area', and when you turn 
>> off a series, set it to type 'line'.  This also avoids the lineWidth 
>> problem, so you can have lineWidth > 0 if you want (you could also set this 
>> by series, if you want to stick with your original solution).  See 
>> http://jsfiddle.net/asgallant/s8wt6/1/
>>
>> On Wednesday, May 15, 2013 11:34:08 AM UTC-4, [email protected] wrote:
>>>
>>> One way around this is to take your code and set calc: function () 
>>> {return 0;} instead of returning null. Then in options I set lineWidth = 0. 
>>>
>>> Not very elegant, but it solves the problem of the area opacity sticking 
>>> around. See: http://jsfiddle.net/s8wt6/
>>>
>>> If you have any other solutions, would love to hear them. 
>>>
>>> On Wednesday, May 15, 2013 11:07:25 AM UTC-4, [email protected] wrote:
>>>>
>>>> Thanks, your hack is exactly what I need.
>>>>
>>>> I tried it implementing it as a stacked area chart. Unfortunately the 
>>>> area opacity of the inactive series remains (unless you start be removing 
>>>> Y1 first). See http://jsfiddle.net/jpkoning/NAehp/
>>>>
>>>> Do you have any ideas on how to fix this problem? I'm fooling around 
>>>> with it right now but am still pretty new to Google Charts, so any advice 
>>>> much appreciated.
>>>>
>>>> On Tuesday, May 14, 2013 6:49:29 PM UTC-4, asgallant wrote:
>>>>>
>>>>> You can't add a checkbox to the legend.  You could disable the chart 
>>>>> legend and build your own in HTML (in which case it can have any features 
>>>>> you want), or you can use something like what I did with this hack: 
>>>>> http://jsfiddle.net/asgallant/6gz2Q/, which turns the inactive series 
>>>>> grey in the legend.
>>>>>
>>>>> On Tuesday, May 14, 2013 5:23:50 PM UTC-4, [email protected] wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I made a stacked area chart that I've got a question about. 
>>>>>>
>>>>>> The chart lets the user remove one series after another in the 
>>>>>> stacked area chart by clicking on the series' respective legend entry. 
>>>>>> The 
>>>>>> original stacked chart can be restored by clicking a refresh button. See:
>>>>>>
>>>>>> www.financialgraphart.com/ecbtool.html    (may take a few seconds to 
>>>>>> load)
>>>>>>
>>>>>> What I really want to do is set up the legend so that there are boxes 
>>>>>> with check marks next to each series in the legend area. When the user 
>>>>>> wants to hide a series, they untick the box. They can bring that 
>>>>>> specific 
>>>>>> series back by reticking the box. How would I go about this? 
>>>>>>
>>>>>> A check mark feature would be provide chart users with much more 
>>>>>> flexibility than the current method I am using -- right now a series 
>>>>>> label 
>>>>>> can no longer be seen in the legend once it is removed, which is 
>>>>>> inconvenient. Sometimes the user only wants to redraw one series -- as I 
>>>>>> have it set up now they have to redraw the entire chart.
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to