How to use the redraw method in ASP.NET Web Forms Chart?
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 following screenshot displays the Chart after calling Redraw method.
Note:
A new version of Essential Studio for ASP.NET is available. Versions prior to the release of Essential Studio 2014, Volume 2 will now be referred to as a classic versions.The new ASP.NET suite is powered by Essential Studio for JavaScript providing client-side rendering of HTML 5-JavaScript controls, offering better performance, and better support for touch interactivity. The new version includes all the features of the old version, so migration is easy.
The Classic controls can be used in existing projects; however, if you are starting a new project, we recommend using the latest version of Essential Studio for ASP.NET. Although Syncfusion will continue to support all Classic Versions, we are happy to assist you in migrating to the newest edition.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls. If you have any queries or require clarifications, please let us know in the comments section below.
You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!