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] <[email protected]> 5CC, Cambridge MA [email protected] <[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]. 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.
