1 Private voidDrawLine (DataTable DT)2 {3 Myalysis.Series.Clear ();4 //icon Position5Myalysis.Legend.AlignmentHorizontal =Legendalignmenthorizontal.right;6Myalysis.Legend.AlignmentVertical =Legendalignmentvertical.top;7ChartTitle ChartTitle =NewChartTitle (); 8Charttitle.textcolor = System.Drawing.Color.Black;//Font Color9Charttitle.font =NewFont ("Tahoma", A);//font Type font sizeTenCharttitle.dock = Charttitledockstyle.bottom;//Title Alignment OneCharttitle.alignment =Stringalignment.far; AMyalysis.Titles.Clear ();//Cleanup Title -Series s_series =NewSeries ("Blood sugar Overview", viewtype.line); -S_series.argumentscaletype = scaletype.qualitative;//x-Axis type theS_series.valuescaletype = scaletype.numerical;//y-Axis type -S_Series.PointOptions.PointView = pointview.values;//display the information and data represented - //x-Axis data fields -S_series.argumentdatamember ="Reporttime"; + //y-axis data fields -s_series.valuedatamembers[0] ="RESULT"; + //defines whether the identifying shape of a point on a line requires A((Lineseriesview) s_series.view). Linemarkeroptions.visible =true; at //define the identification shape of a point on a line -((Lineseriesview) s_series.view). Linemarkeroptions.kind =markerkind.circle; - //define the identification color of points on a line -S_Series.View.Color = colortranslator.fromhtml ("#f90"); - //The value of the intersection above the X and Y axes is not displayed -((Pointserieslabel) S_series.label). Visible =true; in //types of lines, dashed lines, solid lines -((Lineseriesview) s_series.view). Linestyle.dashstyle =Dashstyle.solid; toS_series.datasource =DT; + Myalysis.Series.Add (s_series); - foreach(DataRow Iteminchdt. Rows) the { * if(item["Diagcode"]. ToString () = ="1111". ToString ()) $ {Panax NotoginsengSeries ss_series =NewSeries ("", viewtype.line); -Ss_series. View.color =Color.Blue; the((Lineseriesview) ss_series. View). Linemarkeroptions.kind =markerkind.circle; + //x-Axis data fields AS_series.argumentdatamember ="Reporttime"; the //y-axis data fields +s_series.valuedatamembers[0] ="RESULT"; - $Ss_series. Points.Add (NewSeriespoint (item["Reporttime"], item["result"]. ToString ())); $ Myalysis.Series.Add (ss_series); - } - } the //Increase Level cordon -Constantline constantLine1 =Newconstantline ();WuyiConstantline ConstantLine2 =Newconstantline (); theConstantline2.axisvalue =3.9; -Constantline1.axisvalue =Ten; WuConstantline2.legendtext ="Normal lower limit (3.9)"; -Constantline1.legendtext ="Normal upper Limit (10.0)"; AboutConstantLine1.Title.TextColor =color.red; $Constantline1.color =color.red; -Constantline2.color =Color.green; -ConstantLine1.LineStyle.DashStyle =Dashstyle.solid; -ConstantLine2.LineStyle.DashStyle =Dashstyle.solid; AXydiagram Labdiagram =(Xydiagram) Myalysis.diagram;
Remove lines from the graph +LabDiagram.AxisY.GridLines.Visible =false; - labDiagram.AxisY.ConstantLines.Clear (); $ LabDiagram.AxisY.ConstantLines.Add (constantLine1); the LabDiagram.AxisY.ConstantLines.Add (constantLine2); the the}
Devexpress.chartcontrot Picture Trend Chart