Dotnetcharting is a great. NET chart control, very good for Chinese support, easy to operate, fast to develop, both for WebForm and for WinForm, and. net1.1 and 2.0 are supported. The official address is http://www.dotnetcharting.com/.
Simple way to use:
1. The first thing to do is to fix the Help document: Download the extract from the official website and set the dotnetcharting4.2for1.x directory to a virtual directory,. net1.1 environment, then you can see the help example.
2. Add \bin\dotnetcharting.dll to the toolbox and add references
3. Drag the control onto your Web page and add the reference using Dotnetcharting; you can use it.
4. The use of a simple histogram (dynamic acquisition of data): It has a type attribute to decide whether it is a histogram or a pie chart or other, set to Combo is a bar chart;
private void Drawing (Arraylist list) {Charting show = new Charting (); Show. Title = "MyChart"; Show. Ytitle = "Y Axis Label"; Show. Xtitle = "X Axis Label"; Show. Pichight = 400; Show. Picwidth = 400; Show. seriesname = "specific Details"; Show. Phaysicalimagepath = @ "~/pictrue"; This is the path saved for the picture and will not appear (same as) show if it does not exist. FileName = "Combo.png"; Show. Type = Charttype.combo;//combo is a histogram, pie is a pie chart show. Use3d = false; Show. DataSource = Getdatasource (); Show. Createstatisticpic (this. CHART1); } private SeriesCollection Getdatasource () {SeriesCollection SC = new SeriesCollection (); Random MyR = new Random (); for (int a = 0; a < 4; a++) {series S = new Series (); S.name = "Series" + A; for (int b = 0; b < 5; b++) { Element e = new Element (); E.name = "E" + B; E.yvalue = Myr.next (50); S.elements.add (e); } SC. ADD (s); } }
/** author:peace * Email: [Email protected] * date:2009-4-18*/usingSystem;usingSystem.Data;usingSystem.Collections;usingSystem.Collections.Generic;usingSystem.Configuration;usingsystem.web;usingdotnetcharting;namespacechartextents{/// <summary> ///Summary description of charting/// </summary> Public classCharting {Private string_phaysicalimagepath;//Picture Storage Path Private string_title;//Picture Title Private string_xtitle;//picture x coordinate name Private string_ytitle;//picture y coordinate name Private string_seriesname;//Legend Name Private int_picwidth;//Picture Width Private int_pichight;//Picture Height PrivateChartType _type;//Chart types (cylindrical, linear, etc.) Private BOOL_use3d;//whether it is displayed as a 3-dimensional picture PrivateSeriesCollection _dt;//Chart Data Source Private string_filename;//the name of the statistics picture (not including the suffix name) /**/ /// <summary> ///Picture Storage Path/// </summary> Public stringPhaysicalimagepath {Set{_phaysicalimagepath =value;} Get{return_phaysicalimagepath;} } /**/ /// <summary> ///Picture Title/// </summary> Public stringTitle {Set{_title =value;} Get{return_title;} } /**/ /// <summary> ///picture x coordinate name/// </summary> Public stringXtitle {Set{_xtitle =value;} Get{return_xtitle;} } /**/ /// <summary> ///picture y coordinate name/// </summary> Public stringYtitle {Set{_ytitle =value;} Get{return_ytitle;} } /**/ /// <summary> ///Legend Name/// </summary> Public stringSeriesname {Set{_seriesname =value;} Get{return_seriesname;} } /**/ /// <summary> ///Picture Width/// </summary> Public intPicwidth {Set{_picwidth =value;} Get{return_picwidth;} } /**/ /// <summary> ///Picture Height/// </summary> Public intPichight {Set{_pichight =value;} Get{return_pichight;} } /// <summary> ///Chart types (cylindrical, linear, etc.)/// </summary> PublicChartType Type {Set{_type =value;} Get{return_type;} } /// <summary> ///whether to display the output picture as a three-dimensional/// </summary> Public BOOLUse3d {Set{_use3d =value;} Get{return_use3d;} } /// <summary> ///Compare graphic data sources/// </summary> PublicSeriesCollection DataSource {Set{_dt =value;} Get{return_dt;} } /// <summary> ///generate a name for the statistics picture/// </summary> Public stringFileName {Set{_filename =value;} Get{return_filename;} } /// <summary> ///Generate statistics Pictures/// </summary> /// <param name= "chart" ></param> /// <param name= "type" >graphic categories, such as bars, creases</param> Public voidcreatestatisticpic (Dotnetcharting.chart chart) {chart. Title= This. Title; Chart. XAxis.Label.Text= This. Xtitle; Chart. YAxis.Label.Text= This. Ytitle; Chart. Tempdirectory= This. Phaysicalimagepath; Chart. Filemanager.filename= This. FileName; Chart. Width= This. Picwidth; Chart. Height= This. Pichight; Chart. Type= This. Type; //Chart. Series.type = this. Type;//not applicable when generating a line chart for comparisonChart. Defaultseries.type = This. Type;//uniform use of default sequence diagram type propertiesChart. Series.Name = This. Seriesname; Chart. SeriesCollection.Add ( This. DataSource); Chart. DefaultSeries.DefaultElement.ShowValue=true; Chart. Shadingeffect=true; Chart. Use3d= This. Use3d; Chart. Series.DefaultElement.ShowValue=true; } }}
Dotnetcharting generate histograms, pie charts and other charts