EDN Admin
Well-known member
The Microsoft Chart controls are a series of classes in the http://msdn.microsoft.com/en-us/library/system.web.ui.datavisualization.charting.aspx
namespace that allow web developers to ability to add charts to their ASP.NET applications. The most pertinent charting-related class is the
http://msdn.microsoft.com/en-us/library/system.web.ui.datavisualization.charting.chart.aspx
class , which contains information about
the charts appearance, series, charting areas, and so forth. In most of the demos and code samples weve explored thus far, weve used the
class
as a Web control, adding the
declarative markup to our ASP.NET page, setting a few properties and, occasionally, writing a few lines
of code. When used as a Web control, the
class both creates the chart (as an image) and then renders an
element that points
to the generated chart image.
Using the Chart Web control is a standard practice in a WebForms application, but it is not suggested when building an
http://www.asp.net/mvc ASP.NET MVC application. (While it is possible to add Web controls - including the Chat Web control - to the views of an
ASP.NET MVC application, it is generally frowned upon.) So, if we cant use the Chart Web control in an ASP.NET MVC application, how do we display a chart?
In addition to being used as a Web control, the
class can also be used programmatically. It is quite possible to create a new
object,
set some properties, plot the data points, and then generate the chart image. In fact, we looked at using this technique in an earlier installment,
http://www.4guysfromrolla.com/articles/093009-1.aspx Programmatically Generating Chart Images , in which we saw (among other things) how to generate chart
images programmatically and add them as attachments in an email message.
This article explores how to display charts in an ASP.NET MVC application. Read on to learn more!
http://www.4guysfromrolla.com/articles/092210-1.aspx" class="readmore Read More >
View the full article
Code:
System.Web.UI.DataVisualization.Charting
http://msdn.microsoft.com/en-us/library/system.web.ui.datavisualization.charting.chart.aspx
Code:
Chart
the charts appearance, series, charting areas, and so forth. In most of the demos and code samples weve explored thus far, weve used the
Code:
Chart
as a Web control, adding the
Code:
<asp:Chart>
of code. When used as a Web control, the
Code:
Chart
Code:
<img>
to the generated chart image.
Using the Chart Web control is a standard practice in a WebForms application, but it is not suggested when building an
http://www.asp.net/mvc ASP.NET MVC application. (While it is possible to add Web controls - including the Chat Web control - to the views of an
ASP.NET MVC application, it is generally frowned upon.) So, if we cant use the Chart Web control in an ASP.NET MVC application, how do we display a chart?
In addition to being used as a Web control, the
Code:
Chart
Code:
Chart
set some properties, plot the data points, and then generate the chart image. In fact, we looked at using this technique in an earlier installment,
http://www.4guysfromrolla.com/articles/093009-1.aspx Programmatically Generating Chart Images , in which we saw (among other things) how to generate chart
images programmatically and add them as attachments in an email message.
This article explores how to display charts in an ASP.NET MVC application. Read on to learn more!
http://www.4guysfromrolla.com/articles/092210-1.aspx" class="readmore Read More >
View the full article