[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;