Tweet
SIGN UP
MEMBER LOGIN:
TECHNOLOGIES
.NET 4.5
.NET Remoting in C#
Active Directory C#
ADO.NET in C#
AJAX in C#
Algorithms in C#
Android Programming
Articles C#
ASP, JavaScript, CSS
ASP.NET Controls in C#
ASP.NET MVC with C#
ASP.NET Programming
BizTalk Server
C# Assemblies
C# Language
C# Tutorials
C, C++, MFC
Career Advice
Chapters
Cloud Computing
COBOL.NET
Coding Best Practices
COM Interop
Compact Framework
Cryptography C#
Crystal Reports C#
Current Affairs
Custom Controls C#
Databases & DBA
Deployment
Design & Architecture
DirectX C#
Enterprise Development
Error Zone
Exception Handling C#
Expression Studio
F#
Files, Directories in C#
Financial Applications
Games Programming C#
GDI+ & Graphics
Hardware
How do I
HTML 5
Internet & Web
iPhone/iPad
Java
Java and .NET
JQuery
JSP
Leadership
Learn .NET
LINQ with C#
Metro Style Apps in C#
Mobile & Embedded
MonoDevelop
MSMQ in C#
Multithreading in C#
Networking
Office Development
OOP/OOD
Operating Systems
PHP
Printing in C#
Products
Project Management
Reports using C#
Robotics & Hardware
Security in .NET
SharePoint
Silverlight with C#
Smart Devices
Speech in C#
SQL
SQL Server 2012
String in C#
Team Foundation & VSS
Testing
Visual Basic .NET
Visual C#
Visual Studio .NET
Visual Studio 11
Visual Studio 2010
VS LightSwitch 2011
WCF with C#
Web Forms C#
Web Services in C#
WebForms Controls
Windows 8 in C#
Windows Controls C#
Windows Forms C#
Windows Phone in C#
Windows PowerShell
Windows Services in C#
Workflow Foundation in C#
WPF with C#
XAML with C#
XML in C#
XNA with C#
FORUMS
BLOGS
VIDEOS
INTERVIEWS
CERTIFICATIONS
DOWNLOADS
BOOKS
LINKS
NEWS
Learn .NET in 60 days – Part 1 (13 Labs)
Learn MVC (Model view controller) Step by Step ...
Learn C# Corner - Home
Using Border Radius and Gradients in CSS3: Part I
Learn C# Corner - Footer
Learn .NET and C# in 60 Days Lab13(Day 5): - C ...
iPhone 5 First Look
Samsung Galaxy Note Review
WCF - Authentication and Authorization in Ente ...
How to write a good article on C# Corner
Blog
Chart Control in C#
Posted by
Dhaval Patel
in
Blogs
|
C# Language
on
Oct 12, 2011
This blog shows you how to create a chart for web forms using C#, you will be able to create a chart in a quick manner.
Tweet
1556
0
0
Download Files:
Articles.rar
Creating Chart
Basically you need the Chart, ChartArea, Legend, and a Series to get started developing chart
Add reference for chart in code behind and also include Microsoft .NET Framework 3.5 Service Pack 1
Using System.Web.UI.DataVisualization.Charting;
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 =
new
System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend1 =
new
System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series1 =
new
System.Windows.Forms.DataVisualization.Charting.Series();
chartArea1.Name =
"ChartArea1"
;
this
.chartMain.ChartAreas.Add(chartArea1);
legend1.Name =
"Legend1"
;
this
.chartMain.Legends.Add(legend1);
this
.chartMain.Location
=
new
System.Drawing.Point(217, 12);
this
.chartMain.Name
=
"chartMain"
;
series1.ChartArea =
"ChartArea1"
;
series1.Legend =
"Legend1"
;
series1.Name =
"Series1"
;
this
.chartMain.Series.Add(series1);
this
.chartMain.Size
=
new
System.Drawing.Size(504, 414);
this
.chartMain.TabIndex
= 0;
this
.chartMain.Text
=
"chart1"
;
this
.Controls.Add(
this
.chartMain
);
//where 'this' is the Form
Basically you need the Chart, ChartArea, Legend, and a Series to get started.
This sample demonstrates how to display 3D Bar and Column charts as cylinders.
share this blog :
Check Roles instance running in ..
Leverage “using” in C#
Related Blogs
Program execution in C#
Chart for access specifier
Runtime co-ordination of controls residing in two different forms
Some C# Tips
Introduction to C#
Model View Control (MVC) Pattern using C# - real life example
post comment
Sponsored by
Become a Sponsor
More Blogs from this Blogger
Update Session Object
How to Update Session Object in C#
Create Calander using Sql server Store Procedure
How to Get sum of first record amount and second amount is in Total Amount using Sql server STored Procedure
How to get Week First and Last day and also running week Number using Sql server
How to update grid data without page refresh in c#
Jquery using make change in stylesheet
Jquery using Insert button after page load then make fade in and out
How to Hide url Extension using Global.asax
Search into Textbox and Bind Gridview using Asp.net
View All
Latest Blogs
WebPart Collector or WebPart Finder
Free Ride is Over for Desktop Developers in Visual Studio 11
DotNet developers most used application/tools launching through 'Run'
80-inch Windows 8 Tablet
Data encapsulation
Option to access the Column Names in Data table
Open multiple windows in browser startup. (Multiple homepages option)
I'm Sorry
const and readonly
Address, Binding and Contract in WCF
View All
Sponsored by
Become a Sponsor