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

PieChart


AreaChart

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!!



Subscribe to GET LATEST ARTICLES!


Related

Dot Net 8377261109445881378

Post a Comment

  1. really nice article to understand Chart control

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

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

    ReplyDelete
    Replies
    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.

      Delete
  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 (www.nevron.com) or Devexpress (www.devexpress.com) and I wonder if MS will do something similar to extend their control...

    ReplyDelete
  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.

    ReplyDelete
  6. Nice tutorial! You can also check out this amazing chart control from ShieldUI: https://demos.shieldui.com/web/area-chart/axis-marker

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

    ReplyDelete
  8. 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 바카라사이트

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

    ReplyDelete
  10. 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 (NPD.com), 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.

    ReplyDelete
  11. You completely match our expectation and the variety of our information
    토토
    경마

    ReplyDelete
  12. Many times, most of the players will refuse to play free online games that the website provides for the simple reason that they have seen the conditions. so I don't want to follow because there must be turnover can only give this round, then can withdraw the money, but in fact, if Let's just think about it. You can make a great turnover. Of course, if you are thinking of playing online games. ambbet

    ReplyDelete
  13. They all said in unison that they had received the prize money.

    And the game is very fun, stable and the picture is very beautiful. There are many different types of slot games to choose from. Making our game camp popular and if you want to have all aspects of service, you should not miss Pgslot, which is one of the most interesting gambling game camps to play. ambbet

    ReplyDelete
  14. popular Because because it allows players to make money. that come in to play the easiest where the players do not have to have a headache And you don't have to play a lot, just having capital can play Ready to win money and also have a large prize the most simple Along with playing a new game because by ambbet

    ReplyDelete
  15. Playing slots, another important thing for playing basic slots is probably from the system. If the system is convenient to use, every step can be made by yourself. This can reduce the time waiting for credits to enter the game. This difference allows us to develop a system of ambbets to meet and adapt to daily life. pgslot

    ReplyDelete
  16. Slotxo, useful information for online slots games
    Slotxo If the new gambler doesn't know the details about online gambling games such as online slots games, so we would like to recommend you that the information is very important. We want you to have a try. along with studying the details ambbet

    ReplyDelete
  17. Promotions that are distributed at every moment for gamblers who have applied and top-up can be promoted according to the conditions that our website has determined, whether it is a very good value, we would like to I recommend you to get the bonus because it is a worthwhile investment. ambbet

    ReplyDelete
  18. playing online slots games as well, and whether you use any website or any game camp. The eyes have both advantages and disadvantages that are similar because the format of the slot game in each game camp and the gaming website are all similar because the pgslot

    ReplyDelete
  19. The charge being leveled against the Oscars is of racism; that consciously or not, members of the Academy consistently fail to appreciate and honor the work of non-white actors. The basis for the charge is that there have been enough nominations and enough awards given to detect a bias. That is, if Oscars were awarded like lottery winnings, by sheer chance alone non-white actors would take home a more proportionate share of the little statues, so there is cause to believe that somehow the creep of racial bias is contaminating the nomination process. The fact that 94 percent of voting members are white doesn’t exactly ease fears that the Academy is playing racial favorites. ambbet

    ReplyDelete
  20. A new and hot new slot game from superslot camps like Plants vs Dinos that comes with cute themes and characters that may appeal to slot game players quite a bit. From testing this online slot game 100 times, it was found that the chances of players getting a Free Spin bonus dropped 2-3 times, but it may seem small, but the rewards and bonuses received are worth it. If a player wants to invest in an award-winning slot game, Plants vs Dinos from superslot is a good choice as well. pgslot

    ReplyDelete
  21. Every game camp is unique. In terms of characters, presentations, different slot games, you can to choose to play slots games according to your preferences which in the slot game each type There will be both slot games that are presented from the characters. or online slot games that are presented from fairy tales or other dramas, which amb

    ReplyDelete
  22. Online slots promotions and fish shooting games, both SlotXO and Live22 brands, great promotions, free credits, slotsxo, strong promotions, heavy giveaways, less conditions You can follow the details and updates of our promotions, WINBIGSLOT every week and every month, especially free credit giveaway activities, which will be organized in cycles. Each round is limited to the number of users to distribute. You can follow them on the web page. WINBIGSLOT.com superSlot

    ReplyDelete
  23. With the era of technology, online slots have evolved to leap forward, making things more convenient. It has become a popular game. and is also popular to the world in a short time with a stable and fluid system Therefore, there is no interruption when playing as well as being able to log in Login, deposit and withdraw within seconds. บาคาร่า ออนไลน์

    ReplyDelete
  24. Excited dance and today that good online gambling games, we recommend betting on online slots games which have a relatively large payout rate and are quite a game that has a monthly prize draw in January. That's why, so let's look at the games that we will be depositing will have any games. บาคาร่า ออนไลน์

    ReplyDelete
  25. istening to music can be a healing aid, and the music that should be listened to should be comfortable music. Listen and feel good In addition to music that will help us focus more and more, it will also help us relax even more with it. pgslot

    ReplyDelete
  26. Which of our promotions, there will be promotions for new members, promotions for all deposits when you make a deposit. You will receive a bonus immediately. or promotions to return the lost balance to help all your losses can withdraw money It's called if you claim free credit. The way you have to deposit You will be able to have more withdrawal opportunities. สล็อต

    ReplyDelete
  27. Online slots, a gambling game that many gamblers are popular and interested in choosing to bet on. together a lot because at present can make money from Online slots games are very good, which at present have slotxo

    ReplyDelete
  28. In 2022, our G2G8B website has been updated to the newest version. By focusing on fixing the bugs that are there and improving on the already good, even better after all the updates are done. Now we are a website with various services that have been developed to the maximum. If used during this time, I certify that You will definitely be impressed every time you use it. We will give an example of the service that has been updated in the last 3 items as follows. บาคาร่า

    ReplyDelete
  29. games because it is a function that allows us to spin the wheel. And this button must be said that it is the บาคาร่า

    ReplyDelete
  30. Spins Played by admin You can choose to use it according to your needs. free unlimited pgslot

    ReplyDelete
  31. Online slots online games that anyone may be able to Only then have money to try to press... บาคาร่า

    ReplyDelete
  32. Designed as a thrilling competitive game with a very high payout ratio. The exclusivity of betting slot games of The Joker Slot Camp บาคาร่า

    ReplyDelete
  33. Money is wasted coming out of the house for a vehicle to play with it, which is not possible for those who venture. ambbet

    ReplyDelete
  34. PG camp slots will already know what the advantages of this camp are because the slots games of this camp are novice players. Anyone who has tried to play it must be addicted to each other for sure. ambbet

    ReplyDelete
  35. Online slots games nowadays There is a variety for players to meet, inspired by many places on the web. สมัครสมาชิกสล็อต pg

    ReplyDelete
  36. Than other games And this is another result that makes Fortune Tiger slots games online slots games. Make the most money right now ข่าวบอลวันนี้

    ReplyDelete
  37. There are countless games. There are more than 200 games for you to bet and earn easily with our website. sexybacarat

    ReplyDelete
  38. because with the method of applying through the automatic system because with the method of applying through the automatic system pgslot

    ReplyDelete
  39. online gambling games until it becomes a matter that you are not relying on just technique The collection of songs alone still requires technique. pgslot

    ReplyDelete
  40. Must know the cartoon that is known as the best legendary cartoon. It is also the national cartoon of Japan. pgslot

    ReplyDelete
  41. Online slots games on mobile phones, top up, withdraw via automatic system, deposit-withdraw in 5 seconds only. pgslot เว็บตรง

    ReplyDelete
  42. For customers who are interested in the game and want the most popular online slot games. pgslot

    ReplyDelete
  43. popular online games. The game with the fastest mobile phone popular online games. The game with the fastest mobile phone amb

    ReplyDelete
  44. Don't miss it because you don't go there because you will have intellectual doubts... สล็อต

    ReplyDelete
  45. Fish shooting game. If talking about this game, no one will know for sure. especially the players สมัครสมาชิกสล็อต pg

    ReplyDelete
  46. For choosing to play online gambling sites that can make money and choosing a website to make money, it must be a website that is quite standard and quality that we can trust. Joker123

    ReplyDelete
  47. Pro slots, new members, joker pro, AMBBET slots, straight web, not through agents ข่าวบอลวันนี้

    ReplyDelete
  48. Most other sites will record videos with girls. to show the cards which other websites may not really be live casinos ตารางคะแนน

    ReplyDelete
  49. both on the website AMBSLOT and via Line add, convenient, fast, can make transactions by yourself superslot

    ReplyDelete
  50. Free credit is another important technique for playing online slots games. But that you can win at online slots games. pgslot เว็บตรง

    ReplyDelete
  51. 985 is a simple game, Joker123 is not complicated. or a point that will cause the player to be at a disadvantage in any way But for many players who think that the game is easy to play. pgslot เว็บตรง

    ReplyDelete
  52. Just by crossing the limit of courage. And bring your game betting ability to use every second you spin. pgslot

    ReplyDelete
  53. But a samurai is like a spy. looking for information or working secretly which will not reveal the identity of the slot game joker123

    ReplyDelete
  54. this uniquely entertaining novel."Shandy" is a word of obscure origin meaning "crack-brained, half-crazy" pgslot เว็บตรง

    ReplyDelete
  55. animals. All of them in the past at the Safari not the same as the present Rather, it's an adventure-filled exploration. That makes the slotxo

    ReplyDelete
  56. ned and these reasons may serve as the motivation that you have been looking forned and these reasons may serve as the motivation that you have been looking for ดูบอลออนไลน์

    ReplyDelete
  57. play style that is easy to understand A bet that tells all the details, and most importantly ตารางคะแนน

    ReplyDelete
  58. Strong, even with little capital can join in the fun Bet fully, full, guaranteed in terms of freshness. pgslot

    ReplyDelete
  59. the computer screen. or cell phone I can play either. Because our website supports all systems of use. Can สล็อต

    ReplyDelete
  60. joker123auto wallet entrance, the newest free slot
    joker123auto Joker123 auto online slot withdraw auto joker auto slot just taste joker g pgslot

    ReplyDelete
  61. Web slots that Thai people are popular to play. Big web slots like AMBBET.BAR welcome pgslot เว็บตรง

    ReplyDelete
  62. Join in the fun with good EVENT promotion activities from LUCKY135, direct website, not through agents. Big giveaway, give away points throughout the year. You can still play and lose. pgslot เว็บตรง

    ReplyDelete
  63. Designed to respond to the passion of the most users. Reduce the process of difficulty. Be a master. pgslot เว็บตรง

    ReplyDelete
  64. Play with no limits to earn money. Suitable for players in this era very much. Our website is ready to provide services that meet the needs of the players as much as possible. pgslot

    ReplyDelete
  65. The joker slot, the direct website does not go through an agent wallet, is known as a hot website. สล็อต

    ReplyDelete
  66. Slots are the easiest to break, the most bonuses. Make real profits, no cheating. ดูทีวีออนไลน์

    ReplyDelete
  67. Slots, online games, slots on mobile, top-up-withdrawal via automatic system, 24-hour service, 100% safe and secure. ตารางคะแนน

    ReplyDelete
  68. Get real money at Winbigslot, online slots website that combines popular slot games pgslot

    ReplyDelete
  69. considered to end in a very short time, so we would like to It tells you that you should bet just the right AMBKING

    ReplyDelete

emo-but-icon

SUBSCRIBE


item