Create 3D Charts and Graphs in .NET applications with MS Chart Control

Creating charts and graphs in .NET applications were no easy task before the release of Microsoft Chart Controls. It is now very simple a...

Creating charts and graphs in .NET applications were no easy task before the release of Microsoft Chart Controls. It is now very simple and easy to create charts and graphs in .NET applications with Microsoft Chart Control that is embedded in Visual Studio 2010. The bad news is this is not supported in .NET framework 2.0. If you are lucky enough to work in .NET framework 3.5 or higher, then you can use this chart control to generate all kind of charts instantly.

If you are using Microsoft Visual Studio 2008, you can still install the add-on available for this chart control and include this chart control in your project. Let me explain in simple steps on how to create charts in windows form application to represent data from a sample access database in few easy steps.

Install Microsoft Chart Control in Visual Studio 2008

If you are using Visual Studio 2010, then you can skip this section and proceed to the next section.

1. Download MSChart_VisualStudioAddon.exe from here.

2. Run the executable file and install it. 

3. Now go to ToolBox, Right Click on it, Select 'Choose Items'

4. You will find two Chart controls, one for web application and the other for Windows application. Click on the checkbox near the appropriate chart control based on your type of project. 

Now you can see the Chart Control under the 'Data' category of your toolbox as shown below.

Create Charts & Graphs in Windows Forms Application Using Access Database

1. To Start with, I have created a sample database in the name CompanyRevenue in Microsoft Office Access. I also created a table in the name 'CountryRevenue' with three fields namely ID, Country and Revenue. This table consists of data that gives the revenue generated by the company's products in each country.

2. Create a new windows forms application and add chart control to the form by dragging and dropping the Chart Control on to your form.

3. You can see a sample bar chart appearing on your form in the design view. All you have to do now is just add the data to this chart and change some of the visual properties that would alter the way your chart is rendered. To do this,
  • Right Click on Chart Control and Select 'Properties'.
  • In the 'Properties' window, Click on 'Datasource' -> Add Project Data Source.

  • This will pop up 'Database Configuration Wizard' shown below.

          Select 'Database' -> Click Next -> Select 'DataSet' -> Click Next -> New Connection
  • This will open 'Add Connection' wizard.

          Select "Microsoft Access Database File (OLE DB)" as Datasource and give the path 
          of the access database you are going to use in the 'Database File Name' textbox. 
          I have given the path of the CountryRevenue Database I created previously. 
          Click on "Test Connection" button and if you get an alert saying "Test 
          Succeeded", you are good to proceed with the next set of configurations.
          Click 'OK'.
  • After you click 'OK' on the 'Add Connection' dialogue, the wizard will prompt you to include the necessary data objects for this data source. Here I am going to use 'Coutry' and 'Revenue' columns from country_revenue table. See screenshot below for reference.

         Click on 'Finish' to complete database configuration.
  • In the 'Properties' window, click on 'Series'. You will find a collection of properties under 'Series' -> Go to 'Data Source' -> 'XValueMember -> Select 'Country'. This means that X axis is going to represent values from 'Country' Column of the table. Do the same for 'YValeMember' and select 'Revenue'.

  • To provide text to be displayed on the X and Y axes of your chart, in the 'Properties' window, click on 'Chart Area'. You will find a collection of properties under 'Chart Area'. Now from here click on 'Axes' property.

In 'Axes Collection Editor' dialogue, find the 'Title' Property and edit the title text for both 'X' and 'Y' axes. In the below screenshot I have set the 'Title' property for X axis to be 'Country'.

Thats it! We are good to run the project to view the generated chart with values from our database.

See the output chart in the below screenshot.

Create 3D charts using MS Chart Control

The above output clearly represents the data from our database but the chart is not a 3D chart though. Creating 3D charts is very simple, easy and can be done by just setting 'Enable3D' Property to 'True'. To do this, right click on the chart control -> Properties -> Chart Area -> Area 3D Style -> (Enable3D) -> True. See screenshot below.

Now we have 3D chart in our output.

Change type of Chart Displayed

You can generate many types of charts such as bar chart, pie chart, line graph, point graph etc. by following the above steps in addition with setting one more property to specify the type of chart displayed. 

To select the type of chart you want to display, 
1. Right click on the chart control -> Properties 
2. Properties -> Series -> Chart -> Chart Type
3. Select the chart type you require from the drop down list and run the project.

Output with Different type of Charts



Line Graph

I hope this post helped you to understand how simple it is to create different kinds of charts and graphs in dot net application using Microsoft Chart control. Please leave your comments and queries about this post in the comment sections in order for me to improve my writing skills and to showcase more useful posts. Thanks for reading this!!



Dot Net 8377261109445881378

Post a Comment

  1. really nice article to understand Chart control

  2. very good article for starting with chart controls:)

  3. I go through the same process and at last i couldnot found the chart control in my toolbox....please help me.

    1. What is the version of Dotnet framework you are using? Microsoft charts are supported only in .net framework version 3.5 or higher as I have mentioned already.

  4. The MS chart control is actually a stripped down version of Dundas chart, which never really had a true 3D. As a result it cannot display most of the usable 3D charts like surface, xy scatter point or vector field. Unfortunately charts that can do similar stuff are pricey - Nevron Chart ( or Devexpress ( and I wonder if MS will do something similar to extend their control...

  5. I want result of project in graph format for precision and recall values. My project is in .net language.
    Help to solve this problem.
    pls reply soon.

  6. Nice tutorial! You can also check out this amazing chart control from ShieldUI:

  7. I am sure this article has touched all the internet viewers, its really really nice post on building up new website. 메이저사이트

  8. Hey! I'd like to start a blog so I can easily share my own experience and feelings online. Please let me know if you have any kind of ideas or tips for new
    aspiring blog owners. 경마사이트

  9. Hello There. I discovered your blog using msn. That is a really well written article.
    I will be sure to bookmark it and come back to learn extra of your helpful information. Thanks for the post.
    I'll certainly comeback 바카라사이트

  10. you are really a good webmaster. The web site loading speed
    is amazing. It seems that you are doing any unique trick. 토토

  11. Numerous consumers mention they prefer a wall surface surface-mountable HDTV. According to the NPD Team, a customer as well as retail marketing research details company (, just 13 percent of present LCD television proprietors as well as 25 percent of plasma television proprietors state their collection is placed on the wall surface see more.

  12. You completely match our expectation and the variety of our information

  13. I will pass this blog to many people. Definitely a good blog is very good. Thank you for sharing.

  14. Slot game of that PG slot game camp. There are many games for you to choose from. It depends on the player's preferences. that players will like to play in any form But that you will be able to make money from playing online slots games. It will require a technique to play. The technique of playing each person has a different way of playing. เติมเกม