)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to use the redraw method in chart?

Platform: ASP.NET Web Forms |
Control: Chart |
Published Date: January 19, 2015 |
Last Revised Date: July 2, 2019

The redraw method is used to dynamically refresh the chart content and redraw the chart based on the updated values. Refer to the following code example that explains how to redraw and update the chart on button click by using redraw method.

ASP

<ej:Chart ID="container" runat="server">
        <Series>
           <ej:Series Name="India" Type="Spline">
               <Marker Visible="true" Shape="Circle"><Size Width="6" Height="6" /></Marker>
               <Points>
                   <ej:Points X="Jan" Y="33"></ej:Points>
                   <ej:Points X="Feb" Y="43"></ej:Points>
                   <ej:Points X="Mar" Y="65"></ej:Points>                                                                                                     
                   <ej:Points X="Apr" Y="25"></ej:Points>
                   <ej:Points X="May" Y="62"></ej:Points>
                   <ej:Points X="Jun" Y="36"></ej:Points>
                   <ej:Points X="Jul" Y="72"></ej:Points>
                   <ej:Points X="Aug" Y="17"></ej:Points>
                   <ej:Points X="Sep" Y="36"></ej:Points>
                   <ej:Points X="Oct" Y="54"></ej:Points>
                   <ej:Points X="Nov" Y="26"></ej:Points>
                   <ej:Points X="Dec" Y="73"></ej:Points>
               </Points>
           </ej:Series>
        </Series>
    </ej:Chart>
    <input type="button" onclick="Redraw()" value="Redraw" />
    <script type="text/javascript">
        function Redraw() {
            chartObj = $("#container").ejChart("instance");
            chartObj.model.series[0].points[5].y = 5;
            chartObj.model.series[0].type = "column";
            $("#container").ejChart("redraw");
        }
    </script>

 

The following screenshot displays the Chart on page load.

The Chart on page load

The following screenshot displays the Chart after calling Redraw method.

The Chart after calling Redraw method

 

2X faster development

The ultimate ASP.NET Web Forms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon