Thursday, January 14, 2010

Using Microsoft Chart Controls in the .NET 2.0 Framework

In .NET 3.5 SP1, Microsoft introduced the chart controls to the framework. This set of controls provide rich visualization of data in a different kinds of graphs and charts. The controls are databindable and highly customizable.

I happened to work at a project that required us to stick to the 2.0 version of the .NET framework due to production environment running on Windows 2000. Since I could see the graph controls would add business value to our application, I wanted to figure out if one could run the controls on a 2.0 framework - and you can. You might argue we live in the stone age (and you're right), but I'm sure we're not the only company left in the world in this situation. Therefore I here present you with a step-by-step guide on how to get your .NET Forms project running on a .NET 2.0-based client with chart controls. One catch: the development environment needs to have .NET 3.5 SP1 installed.

Step 1 through 3 are general installation instructions, 4 is the key to making it work on the 2.0 platform:

  1. Make sure you have .NET Framework 3.5 installed on your developer computer.

  2. Download and install Microsoft Chart Controls for .NET 3.5 from on the developer computer.

  3. Open the Visual Studio project you want to work with and make sure you have the Chart control listed under the Data tab in the toolbox. If you don't: Select and right click the data tab and select Choose items, then scroll down and select the two Chart controls listed under .NET Framework Components.

  4. Add the following DLL as a reference to your project:

    C:\Program Files\Microsoft Chart Controls\Assemblies\System.Windows.Forms.DataVisualization.dll

    Open the properties of the reference and set Copy local to true
This will ensure that the Visualization-DLL is copied to the output folder when building or when building a MSI file from a setup project.

Happy charting!


  1. Hello,
    Tips does not works because System.Windows.Forms.DataVisualization.Charting use type from 3.5 like DateTimeOffSet

  2. Actually I'm using this in a system in production today without problems. Have you tried it? If you're using Visual Studio 2010, maybe it is stricter on compile-time-checking. Just guessing here...

  3. I did try it, was hoping it would work, but so far no luck. Chart simply does not appear on the test machine, which is a freshly installed XP Pro SP3 with only .NET 2.0 installed. I need this to work on Windows 2000 systems if possible!

  4. Do you get an exception instead if you remove the .DLL's from the folder? Could it be that an exception is occuring in the creating of the graphs that is not renderd to the user? Try to get some more debug info on what's going on.

  5. I realize this is an older thread, but I was wondering if you had used this control in a 2.0 site. Also did run into any issues deploying it to a production server running a 2.0 site?

  6. I havent testes with ASP.NET 2.0 myself, so I cannot say for sure. I could only advice you to give it a try. You should be able to apply the same method to extract the System.Web.Ui.DataVisualization.Charting.dll as for the WinForms DLL.

  7. It works. Although you can't directly drag and drop MS Chart from toolbox in .Net 2.0 project. But you can copy a MS Chart object from a WinForm in .Net 3.5Sp1 project, then paste it into a WinForm in .Net 2.0 project. Finally, you will get a MS Chart on WinForm just as it is dragged from toolbox.
    I had tested it to run on Windows 2000.
    Many thanks to Frode.

  8. Getns any one can help, I am getting Error :An unhandled exception of type 'System.StackOverflowException' occurred in System.Windows.Forms.DataVisualization.dll while using VS2005 Chart Control to display data

  9. Replies
    1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Training in Chennai. or learn thru ASP.NET Essential Training Online . Nowadays Dot Net has tons of job opportunities on various vertical industry.
      or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.

  10. Amazing article, thanks a lot, me and my colleagues found out a lot of new from it, and we hope that this knowledge somehow will be useful for us in the future. In return we will be very glad to share with u our favourite website where we always discover some interesting applications!

  11. Google's army of 7000+ employees are loyal to the company. Over at Microsoft, the employees, especially senior executives, feel caged within the company; leaving Microsoft for Google might bring a lawsuit from the company, as it did for Kai-Fu Lee. best office team timesheet solution

  12. By reading this article I get a lot of lessons and this is very useful . cara menggugurkan kandungan

  13. One of the greatest protests about Windows 8 was the expulsion of the Start catch.california solar companies

  14. The strength and knowledge of a Microsoft Certified Master begins with an experienced-based training based on their curriculum that is built on, by the foundation of expert-level classroom trainees.
    MCSE Training London

  15. If you are a business or enterprise, your Microsoft support needs will be well supported by different support options. You can search for Microsoft support options online and zero in on the desired one.reset windows 10 password