[DevExpress] ChartControl: Creates the Title and chartcontrol of the Drill-Down style.

Source: Internet
Author: User

[DevExpress] ChartControl: Creates the Title and chartcontrol of the Drill-Down style.

Key code:

/// <Summary> /// create the Title of the Drill-Down style /// </summary> /// <param name = "chart"> ChartControl </param>/ // <param name = "title"> title text </param> // <param name = "visible"> visible </param> public static void AddDrillDownTitle (this ChartControl chart, string title, bool visible) {ChartTitle _ chartTitle = new ChartTitle (); _ chartTitle. alignment = StringAlignment. near; _ chartTitle. antialiasing = false; _ chartTitle. font = new Font ("Tahoma", 10F, FontStyle. underline); _ chartTitle. indent = 20; _ chartTitle. text = title; _ chartTitle. textColor = Color. royalBlue; _ chartTitle. visible = false; chart. titles. add (_ chartTitle );}
Running effect:
 
Hope this is helpful! Thank you!
 

How can I use the devexpress control to display multiple curves in chartcontrol?

This. chartControl1.Series. Clear ();
Series cl = new Series ("average", ViewType. Spline );
Series item_value = new Series ("sample value", ViewType. Spline );
Series ucl = new Series ("control limit", ViewType. Spline );
Series lcl = new Series ("lower control limit", ViewType. Spline );
Decimal stdev = Stdev (dt_k); // Standard Deviation
Decimal ucl_value = UCL (dt_k); // control upper limit (UCL)
Decimal lcl_value = LCL (dt_k); // lower limit of control (LCL)
Decimal cl_vaule = Avg_Item_x (dt_k );
For (int I = 0; I <dt_k.Rows.Count; I ++)
{
Cl. Points. Add (new SeriesPoint (dt_k.Rows [I] ["c_sampleid"]. ToString (), new double [] {Convert. ToDouble (cl_vaule )}));
Item_value.Points.Add (new SeriesPoint (dt_k.Rows [I] ["c_sampleid"]. ToString (),
New double [] {Convert. ToDouble (dt_k.Rows [I] ["C_ITEMVALUE"]. ToString ())}));
Ucl. Points. Add (new SeriesPoint (dt_k.Rows [I] ["c_sampleid"]. ToString (), new double [] {Convert. ToDouble (ucl_value )}));
Lcl. Points. Add (new SeriesPoint (dt_k.Rows [I] ["c_sampleid"]. ToString (), new double [] {Convert. ToDouble (lcl_value )}));
}
This. chartControl1.Series. Add (cl );
This. chartControl1.Series. Add (item_value );
This. chartControl1.Series. Add (ucl );
This. chartControl1.Series. Add (lcl);... the remaining full text>

C #, The chartcontrol control in DevExpress draws a line chart. the X axis only displays the hour, minute, and second.

I am also using this chartcontrol control these two days.
Yes, because it is written in code.
There is nothing in the chartcontrol Control created first. For example, Diagram Legend is null.
So
First, you must create Diagram Legend and other objects and set their attributes,
Assign Diagram Legend and other objects to the corresponding properties of the chartcontrol control.
Var chart = new ChartControl (); var legend = new Legend (); var xyDiagram2D = new XYDiagram2D (); // set the attribute chart of legend xyDiagram2D. di#= xyDiagram2D; chart. legend = legend;

Related Article

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.