Click here to Skip to main content
15,498,966 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi..I am new to C# programming..i had a set data read from .txt file and the data were already store inside an array..now i would like to draw a simple line graph using microsoft visual c# 2005, but there is no control of chart inside the toolbox for this version when i plan to draw it on Form..do u have any idea how to plot a simple line graph using the data from the other class..?thanks in advance..=)
Posted
Updated 10-Jul-12 23:20pm
v2

Have a look at ASP.NET and Windows Forms Chart Controls for .NET Framework 3.5 SP1[^].

It's a free download.

MSChart will not work with older versions of .Net, the download does after all specify .net 3.5 so you need to upgrade Visual studio to version 2008. The component is included with Visual Studio 2010.

Best regards
Espen Harlinn
 
Share this answer
 
v2
Comments
Esmond90 11-Jul-12 4:52am    
yea,i did download and try before but i think the version is not compatible..maybe too old..haha..anyway,thanks a lot!
Sandeep Mewara 13-Jul-12 2:24am    
Good answer. 5!
Espen Harlinn 13-Jul-12 4:11am    
Thank you, Sandeep :-D
Sergey Alexandrovich Kryukov 22-Jul-12 14:45pm     CRLF
Agree, my 5. --SA
Espen Harlinn 22-Jul-12 14:48pm    
Thank you, Sergey :-D
Your big problem is using a very old version of the software: VS2005 is 7 years and three versions old. The MS Chart control was (I think) introduced at .NET V3.5, which came in at VS2008.

Have a look here: A flexible charting library for .NET[^]
It includes a version for .NET 1.1 which VS2005 supports, but I would strongly suggest that you need to update your development environment! MS does do free versions of Visual Studio - they are called the Express versions and are available from thier web site directly.
 
Share this answer
 
Comments
Espen Harlinn 11-Jul-12 4:56am    
You're right, MSChart will not work with older versions of .Net, the download does after all specify .net 3.5
Esmond90 11-Jul-12 4:57am    
ya..i think that is the biggest problem..i try installed the MS chart control but it didn't work..maybe the version is too old..haha..The Zedgraph thing make me even more blur..haha..Thanks for your reply!
I hope below code can help you

C#
SparklineGroup sparklineGroup
= sheet.SparklineGroups.AddGroup(SparklineType.Line);
SparklineCollection sparklines = sparklineGroup.Add();
sparklines.Add(sheet["B2:E2"], sheet["F2"]);
sparklines.Add(sheet["B3:E3"], sheet["F3"]);
sparklines.Add(sheet["B4:E4"], sheet["F4"]);
sparklines.Add(sheet["B5:E5"], sheet["F5"]);


if you still not clear about it,please visit the whole article
http://everlasting129.weebly.com/1/post/2012/01/how-to-insert-sparkline-chart-in-excel-with-c-vbnet.html[^]
 
Share this answer
 
Comments
Esmond90 11-Jul-12 5:59am    
Hmm..I'm not really clear about it but thanks!=)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900