This is a migrated thread and some comments may be shown as answers.

Determine when transition animations complete

1 Answer 98 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Kenn
Top achievements
Rank 1
Kenn asked on 18 Jan 2018, 03:14 PM

I'm using the transitions in order to animate my RadHtmlChart.  However, I'm also using the client side getSVGString() to facilitate allowing the user to download an image of the chart.  I convert the svg string to png on the server and push back to client.  All of this is working EXCEPT, occasionally the getSVGString() is called before the animation has completed.

In order to work around the issue, I'm doing the following:
function setSvgContent<%=Me.ClientID%>() {
            setTimeout(function () {
                var chartRendering = $find("<%=radChart.ClientID%>");
                if (chartRendering != null) {
                    $get("<%=svgHolder.ClientID%>").value = escape(chartRendering.getSVGString());
                }
            }, 2000);
        }

I'm not fond of using a setTimeout and I'd prefer to call the getSVGString() after the animation has completed.

Is there a way to determine when the RadHtmlChart animation has completed??

Thanks!

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 19 Jan 2018, 03:12 PM

Hi Kenn,

You can disable animations by setting the Transitions property to false.

An event for the animations is not available and thus a timeout is the only other options.

If you need to render charts on the server I can also suggest you consider using tools like PhantomJS to spin up the browser on the server so you can get the rendering and the image there, as RadHtmlChart is not designed for this purpose. Its goal is to offload rendering to the client browser.

Regards,

Marin Bratanov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Chart (HTML5)
Asked by
Kenn
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or