Template that uses Dundas pure code calls

xiaoxiao2021-03-06  42

Some controls are also a lot of small components. It is also troublesome every day, so write down the templates. Function: Use Dundas to draw 2 sequences of graphics, graphics dynamically generate code in the program as follows: backend code: Using dundas .CHARTING.WEBCONTROL ;. . . . . Private void Page_load (Object Sender, System.EventArgs E) {// Place the user code here to initialize the page Drawing ();}

Private void drawing () {// created image Dundas.Charting.WebControl.Chart objchart = new chart ();

Objchart .height = (unit) 400; objChart.width = (unit) 600; objChart.backcolor = color.white;

// drawing regions ChartArea objArea1 = new ChartArea (); objChart.ChartAreas.Add (objArea1); objArea1.Name = "region 1"; objArea1.BackColor = Color.AntiqueWhite; objArea1.Area3DStyle.YAngle = 20; objArea1.Area3DStyle. Light = LightStyle.Realistic; objArea1.AxisY.LineColor = Color.Gray; objArea1.AxisY.MajorGrid.LineColor = Color.Gray; // color line objArea1.AxisX.LineColor = Color.Gray; objArea1.AxisX.MajorGrid.LineColor = Color.gray;

The more the sequence is established, the more sequences (cylindrical) series (), the sequence (cylindrical), and the column (); objserieszhu.name = "Cylindrical"; // Sequence Name ObjChart.Series.Add (ObjSerieszhu); ObjSerieszhu .Bordercolor = color.red; ObjSerieszhu.palette = chartcolorpalette.none; // Sequence style color tuning version objserieszhu.color = color.sandyBrown; // sequence style color tuning version ObjSerieszhu.BorderWidth = 1; // sequence Width objserieszhu.type = seriescharttype.column;

// Create sequence (line) Series objSeriesLine = new Series (); objSeriesLine.Name = "dogleg"; // name sequence objChart.Series.Add (objSeriesLine); objSeriesLine.MarkerStyle = MarkerStyle.Triangle; // vertex flag objSeriesLine .BorderWidth = 1; // Sequence width ObjSeriesline.Color = color.blue; // Sequence color objseriesline.type = series; // Polyline display // Add sequence description: Sequence description is generally located below the chart, And it is best to control ObjChart.legends ["default"]. LegendStyle = LegendStyle.table; / / Table situation display ObjChart.Legends ["default"]. Docking = legenddocking.bottom; // ObjectDocking.bottom; // Show ObjChart Legends ["default"]. Alignment = stringAlignment.center;

// Generate data random random = new random (); for (int pointIndex = 0; PointIndex <10; PointIndex ) {ObjChart.series ["Cylindrical"] .points.addy (random.next (45, 95)); Objchart.series ["Passes"] .points.addy (random.next (5, 75));}

ObjChart.Chartareas ["Region 1"]. Axisx.arrows = arrowstype.triangle; // Arrow Objchart.Chartareas ["Region 1"]. Axisy.arrows = arrowstype.triangle; // Arrow Objchart.Chartareas ["Area 1" ] .Axisx.margin = true; / save with blank objChart.Chartareas ["Region 1"]. Axisx.minimum = -1; // Set the axis ObjChart.Chartareas ["Area 1"] .Axisx.maximum = 11;

Pnlinfo.controls.add (objchart);

转载请注明原文地址:https://www.9cbs.com/read-52591.html

New Post(0)