I introduced some free components at the source of the last inspiration. This time, I am very grateful for your use. Usage Webchart The components are really simple and have good results. Now let me briefly introduce how to use it and some notes:
1 First, create a project. Mywebchart
2. Add component in toolbox
After entering the project, right-click the toolbox and click Add / Remove item, go to custom toolbox, Click Browse, and find Webchart. dll File, in Chartcontrol Check the component name and click OK ".
In the toolbox, Web In the form. Chartcontrol Components
3. Use Components
Set Chartcontrol Drag components into the design form
This is simpleChartcontrolThe component diagram shows
4. WriteCode
First, add
UsingWebchart;
ThenPrivate VoidPage_load (ObjectSender, system. eventargs e) Add code
Private VoidPage_load (ObjectSender, system. eventargs E)
{
Chart C =NewAreachart ();
C. Data. Add (NewChartpoint ("Ene", 123 ));
C. Data. Add (NewChartpoint ("Ene", 33 ));
C. Data. Add (NewChartpoint ("Ene", 23 ));
C. Line. Color = color. blue;
Chartcontrol1.charts. Add (C );
Chartcontrol1.redrawchart ();
}
5. Compile and run
everything is ready, start running
How can I see the error? At the beginning, it really gave me a headache. I went to some related websites, especially the official websites, and found no results for a long time, but I finally found it at the end of the Help file, you need to createWebchartsDirectory, And then I created it according to the requirements of the Help file, and then compiled and run it again.
Ah, why is it wrong? I started to feel depressed and thought this component was useless?
Then I started to read the Help file and wrote" If you find an exception of generic error GDI + .... then it means the folder is there, but the user (ASPnet or whatever user you are using) do not have write permissions on the folder ." This makes it clear that if your system disk is NTFS The format must be in Webcharts Add ASPnet . I did what it meant. Wow, it's great.
The effect is good, and there are many properties for you to use with this control, making the interface more intuitive and better-looking.
: Http://www.carlosag.net/Tools/WebChart/Default.aspx