[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>
Character bar chart of DevExpress ChartControl
The Series value cannot be a string, but the label can be displayed as 2013: 1200.