Thursday, January 21, 2010

Microsoft Chart Control in ASP.NET & Windows Forms Application.

Introduction

            Microsoft has launched a cool rich chart control for ASP.NET and Windows Forms applications.

Steps

  • 1. Drag and Drop the Chart control  from the Toolbox under "Data" Tab
  • 2. Set the Properties
  • 3. Change/Set  the Chart Type in Series property.



Available MS Chart Types




Sample ASP.NET Code Snippet


        
            
        
        
            
            
        
        
            
                
            
        
    

In Code Behind Snippet

            double[] yValues = { 153,145,55,266,45,224};
            string[] xNames = { "Jan", "Feb", "Mar", "Apr", "May", "Jun" };
            
            msChartSample.Series[0].Points.DataBindXY(xNames, yValues);

            msChartSample1.Series[0].Points.DataBindXY(xNames, yValues);

Sample Output









For more Sample please refer this URL : http://code.msdn.microsoft.com/mschart/Release/ProjectReleases.aspx?ReleaseId=1591


Prerequisites:

  1. Microsoft Visual Studio 2008 Service Pack 1 : download
  2. Microsoft .NET Framework 3.5 Service Pack 1 : download
  3. Microsoft Chart Controls for Microsoft .NET Framework 3.5 : download 
  4. Microsoft Chart Controls Add-on for Microsoft Visual Studio 2008 : download 

Documentation 

   Microsoft Chart Controls for .NET Framework Documentation : download


With few lines of Code and Properties we'll generate very Cool Charts.


Thank You

No comments: