Chart Control amcharts

Source: Internet
Author: User
ArticleDirectory
    • Line chart
    • Column chart
    • Pie Chart

Amcharts is a powerful chart control that supports JavaScript and falsh display methods and multiple clients such as. net. This document demonstrates the use of amcharts in Asp.net.

Line chart

 

View code

// Line
For ( Int I = 0 ; I < 7 ; I ++)
{
Linechartgraph line = New Linechartgraph ();
Line. Bullet = linechartbullettypes. Square;
Line. forecolor = color. fromname (common. enumerate. linecolor [I]); // Line color
Line. datasource = dthour; // Data Source
Line. dataseriesitemidfield = " Hour " ; // Coordinate field
Line. datavaluefield = " CNT " ; // Value Field
Line. Title = datetime. Now. adddays (-I). tostring ( " Mm-dd " ); // Line name
Line. databind ();

Chart. graphs. Add (line );//Add a line to the main control

}

Chart. datasource = dthour;//Data Source
Chart. dataseriesidfield ="Hour";//X coordinate field
Chart. databind ();

 

View code

// Common attributes
Chart. xgridapproxlinecount = 30 // Coordinate point on the X axis, not fully displayed by default

 

Column chart

 

View code

// Pillar
Columnchartgraph column = New Columnchartgraph ();
Column. datasource = dt_op; // Data Source
Column. dataseriesitemidfield = " DT " ; // Field
Column. datavaluefield = " CNT " ; // Value
Column. Title = linename [I]; // Column name
Column. databind ();

Chart. graphs. Add (column );//Add a bar chart
//Bind Master Control
Chart. datasource = dt_op;
Chart. dataseriesidfield ="DT";
Chart. databind ();

 

View code

// Common attributes
Chart. columndatalabelformatstring = " {Value} " ; // Data display on the column
Chart. columndatalabelposition = columndatalabelpositions. abve; // Location
Chart. Depth = 5 ; // Stereoscopy
Chart. valuesmin = 200 ; // Minimum start value

 

You can add two or more columns to facilitate data comparison. One column can be displayed proportionally by segment.

 

Chart. columntype = columnchartcolumntypes. stacked;

 

Pie Chart

 

Chat_mcc.datasource = dtapp; // Data Source
Chat_mcc.datatitlefield = " ID " ; // Field
Chat_mcc.datavaluefield = " CNT " ;
Chat_mcc.databind ();

 

    • amchart. net controls are developed quickly. It is convenient to dynamically generate code in combination with Code , But Flash is not supported on some platforms.
    • the Javascript display of amchart is not restricted by the platform, but the configuration is relatively troublesome. A single icon requires a separate data file and configuration file
    • some other controls, such as webchart, automatically generate a static image, which affects access when multiple servers are synchronized (SLB).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.