Back to Devexpress

How to: Add a Chart to a Web Page (Runtime Sample)

aspnet-5756-components-chart-control-examples-how-to-add-a-chart-to-a-web-page-runtime-sample.md

latest1.7 KB
Original Source

How to: Add a Chart to a Web Page (Runtime Sample)

  • Nov 03, 2023
  • 3 minutes to read

This tutorial demonstrates how a chart can be generated and shown in a web page with a button click. For an alternative approach to this task, refer to How to: Add a Chart to an ASPxCallbackPanel during its Callback (Runtime Sample).

To demonstrate how this can be done, do the following.

  1. Create a new ASP.NET Web Application or open an existing one.

  2. Switch to the Design view of the Default.aspx page, and drag an ASPxButton from the DX.25.2: Common Controls toolbox tab onto the page. Handle its Click event to generate a web chart.

  3. Add the required assemblies to the project.

  4. Double-click ASPxButton1 to handle its Click event. Add the following code to the event handler.

Run the web application, and click ASPxButton1 to see the chart.

See Also

Concepts

How to: Add a Chart to an ASPxCallbackPanel during its Callback (Runtime Sample)

How to: Bind a Web Chart to Data (Runtime Sample)

How to: Bind a Web Chart to an ASPxPivotGrid