Okay, interesting, so after the clearChart() if you _reuse_ the same chart 
object it seems to work, but if you (for example) wanted to replace the 
barchart with a Piechart, you would need to delete the old chart object and 
create a new one.

Try clicking the Delete button on this version of the fiddle:

https://jsfiddle.net/davies147/1eu7rkvr/11/

If you have the console up you'll also see a backtrace/error if you 
mouse-over the "deleted" graph when an even fires that accesses the cleaned 
up data.

Cheers,
Steve

On Friday, 16 March 2018 13:06:55 UTC, Daniel LaLiberte wrote:
>
> Hi Steve,
>
> I tried adding clearChart() calls to one of the JSFiddles, and it seems to 
> work fine.  I call it just before redrawing, when you push any of the 
> format buttons:  https://jsfiddle.net/1eu7rkvr/1/
> Could you show how you were doing it that caused errors?
>
> On Fri, Mar 16, 2018 at 8:01 AM, Steve Davies <[email protected] 
> <javascript:>> wrote:
>
>> Might it be possible to work around this by calling clearChart() and then 
>> destroy any left-over DOM elements from the report?
>>
>> Just wondering how valid that might prove to be or whether this will 
>> cause any obvious issues?
>>
>> Thanks,
>> Steve
>>
>> On Thursday, 15 March 2018 12:27:44 UTC, Steve Davies wrote:
>>>
>>> Hi,
>>>
>>> I'm having trouble with clearChart() - It works fine on my "core" Pie, 
>>> Bar and Column charts, but on the Material Bar chart, it seems to do some 
>>> sort of broken half-clear, and generally errors shortly afterwards.
>>>
>>> It is easily demonstrated by loading the JSFiddle provided on the Google 
>>> dev docs page, and using it to call clearChart() manually on the console. 
>>> To find the JSFiddle, look for the link in the docs here:
>>>
>>>   
>>> https://developers.google.com/chart/interactive/docs/gallery/barchart#creating-material-bar-charts
>>>
>>> Thanks for any suggestions, pointers or fixes :)
>>>
>>> Regards,
>>> Steve
>>>
>>>
> -- 
> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
> [email protected] <javascript:>   5CC, Cambridge MA
>

-- 
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 https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/6d520d88-9f11-48e0-bbab-0a99ee0c33ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to