Thank you Daniel! It works!

Le samedi 4 juillet 2015 20:05:52 UTC+2, Daniel LaLiberte a écrit :
>
> When you open the editor again, you need to use the new wrapper.
>
> When you create the image, you need to not replace the outerHTML since 
> that is where your id is, so it would never be found again.
>
> It appears that calling getChartWrapper() creates a new chart wrapper each 
> time.  Not sure yet, but if you avoid calling getChartWrapper more than 
> once, it seems to work, with the other changes.  See 
> https://jsfiddle.net/f0ptawpw/5/
>
> On Fri, Jul 3, 2015 at 3:45 AM, Physique Versaillles Crtt <
> [email protected] <javascript:>> wrote:
>
>> I have tried to use the new wrapper with the function getChartWrapper(). 
>> I've also tried to attach the 'ready' event handlder to the new wrapper in 
>> the function 'readyRedraw()' (the 'OK' event handler of chartEditor).
>> But only the old 'ready' event handler  executes once . Even if I change 
>> the diagram after, the new 'ready' event handler does not executed any more.
>>
>> I change the code for the test : https://jsfiddle.net/IvZhc/f0ptawpw/4/
>>
>> Thank you for your response.
>>
>> Le jeudi 2 juillet 2015 17:19:16 UTC+2, Daniel LaLiberte a écrit :
>>>
>>> Hi Physique,
>>>
>>> After editing the chart, a new chart wrapper is constructed and returned 
>>> with getChartWrapper().  You need to use that one thereafter rather than 
>>> your original wrapper.  I'm not sure whether you'll need to attach new 
>>> event handlers to that new chart wrapper, or if the chart editor 
>>> automatically rebinds the same handlers, but I suspect you will.  We should 
>>> update the documentation to clarify all this.
>>>
>>> On Thu, Jul 2, 2015 at 6:13 AM, Physique Versaillles Crtt <
>>> [email protected]> wrote:
>>>
>>>> I've already used OK event and ready event. This is the example of 
>>>> jsfiddle what I made.
>>>>
>>>>     https://jsfiddle.net/IvZhc/f0ptawpw/2/
>>>>
>>>> When I click 'Click Me', the diagram is opened in a new tab. When I 
>>>> click 'Edit me', then I click 'Clike Me', I want that the new diagram is 
>>>> opened. But now, the old diagram is always opened.
>>>>
>>>> I tried to use the code below in the function 'redrawChart()' to get 
>>>> the adresse of the new diagram: 
>>>>
>>>> var imgMachineURI = 
>>>> chartEditor.getChartWrapper().getChart().getImageURI();
>>>>
>>>> But chartEditor.getChartWrapper().getChart() return 'null'. (No matter 
>>>> I put the code before or after '
>>>> chartEditor.getChartWrapper().draw(document.getElementById('vis_div'));
>>>>  ')
>>>>
>>>> So I don't know why. Do you have some ideas?
>>>>
>>>> Thanks
>>>>
>>>> Le vendredi 26 juin 2015 16:25:49 UTC+2, Sergey a écrit :
>>>>>
>>>>> Hi, did you try listening to the OK event, then attaching a listener 
>>>>> for the ready event? Could you make a jsfiddle showing the issue?
>>>>>
>>>>> On Fri, Jun 26, 2015 at 6:09 AM Physique Versaillles Crtt <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hello,
>>>>>>     I use the chartEditor to change the chart, for exemple, from the 
>>>>>> linechart to piechart. At first, I add the 'ready' listener for 
>>>>>> chartWrapper. In the function, I use the fonction getImageURI() to get 
>>>>>> the 
>>>>>> ImageURI. 
>>>>>>     Then, I use the chartEditor to change the chart. I add the 
>>>>>> listener 'OK' for chartEditor. In the fonction 'OK', I couldn't get 
>>>>>> ImageURI().
>>>>>>
>>>>>>     If I use the fonction below
>>>>>>
>>>>>>     chartEditor.getChartWrapper().getChart() 
>>>>>>
>>>>>>     I get 'null'. How can I get the new ImageURI.
>>>>>>
>>>>>> I would like this new ImageURI to print the new image (png) from the 
>>>>>> new chart edited.
>>>>>>
>>>>>> Thank you.
>>>>>>
>>>>>> Best regards
>>>>>>
>>>>>> -- 
>>>>>> 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.
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>  -- 
>>>> 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.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> -- 
>>> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
>>>   - 978-394-1058
>>> [email protected]   5CC, Cambridge MA
>>> [email protected] 9 Juniper Ridge Road, Acton 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] 
>> <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at 
>> http://groups.google.com/group/google-visualization-api.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> 
>  - 978-394-1058
> [email protected] <javascript:>   5CC, Cambridge MA
> [email protected] <javascript:> 9 Juniper Ridge Road, Acton 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 http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to