ChartDirector 6.2 (.NET Edition)

The First ASP.NET MVC Project




This section introduces using ChartDirector in ASP.NET MVC. If you are using ChartDirector in ASP.NET Web Forms, you may refer to The First ASP.NET Web Forms Project. If you are using ChartDirector in Windows Forms, you may refer to The First Windows Forms Project.

To get a feeling of using ChartDirector, and to verify the ChartDirector development environment is set up properly, we will begin by building a very simple bar chart.

The following is based on one of the charts in the sample project "NetMvcCharts". If you have not yet tried the sample project, it is highly recommended you try them now. Please refer to the Installation section for details. They are very useful for exploring and testing the features of ChartDirector.

To create a chart in ASP.NET MVC, the basic method is to create the chart in the controller and assign it to a RazorChartViewer. The RazorChartViewer can then be used in the view to generate the HTML for the chart. The step by step instructions are as follows:

Note: The trial version of ChartDirector will include small yellow banners at the bottom of the charts it produces. These banners will disappear in the licensed version of ChartDirector.