public DivStdFunctionsChart(ChartView BaseChart) { divFunction = new Steema.TeeChart.Functions.Divide(); bar1 = new Bar(); bar2 = new Bar(); theDivLine = new Line(); var = new Variables.Variables(); for (int i = 0; i < var.GetValorStdDiv1.Length; i++) { bar1.Add(i, var.GetValorStdDiv1[i]); } for (int i = 0; i < var.GetValorStdDiv2.Length; i++) { bar2.Add(i, var.GetValorStdDiv2[i]); } BaseChart.Chart.Series.Add(bar1); BaseChart.Chart.Series.Add(bar2); BaseChart.Chart.Series.Add(theDivLine); theDivLine.Function = divFunction; theDivLine.DataSource = new object[] { bar1, bar2 }; bar1.SeriesColor = var.GetPaletteBasic[0]; bar2.SeriesColor = var.GetPaletteBasic[1]; theDivLine.SeriesColor = var.GetPaletteBasic[2]; bar1.Title = "Data 1"; bar1.MarksOnBar = true; bar1.MarksLocation = MarksLocation.Start; bar2.Title = "Data 2"; bar2.MarksOnBar = true; bar2.MarksLocation = MarksLocation.Start; theDivLine.Title = "Divide"; theDivLine.LinePen.Width = 6; theDivLine.Pointer.Style = PointerStyles.Sphere; theDivLine.Pointer.InflateMargins = true; theDivLine.Pointer.HorizSize = 5; theDivLine.Pointer.VertSize = 5; theDivLine.Pointer.Visible = true; theDivLine.Marks.Visible = true; BaseChart.Chart.Axes.Left.SetMinMax(BaseChart.Chart.Axes.Left.MinYValue + 0.1, BaseChart.Chart.Axes.Left.MaxYValue + 2); BaseChart.Chart.Axes.Bottom.SetMinMax(BaseChart.Chart.Axes.Bottom.MinXValue, BaseChart.Chart.Axes.Bottom.MaxXValue); BaseChart.Chart.Axes.Left.Increment = 3; BaseChart.Chart.Axes.Bottom.Labels.Visible = false; BaseChart.Chart.Axes.Left.Grid.Visible = false; BaseChart.Chart.Axes.Left.AxisPen.Visible = true; BaseChart.Chart.Header.Visible = false; bar1.Marks.Font.Size = 14; bar1.Marks.Pen.Visible = false; bar1.Marks.TailStyle = MarksTail.None; bar1.Marks.Height += 4; bar1.Marks.TextAlign = TextAlignment.Center; bar1.Marks.BackColor = Xamarin.Forms.Color.Transparent; bar1.Marks.Font.Color = Color.White; bar2.Marks.Font.Size = 14; bar2.Marks.TailStyle = MarksTail.None; bar2.Marks.TextAlign = TextAlignment.Center; bar2.Marks.BackColor = Xamarin.Forms.Color.Transparent; bar2.Marks.Height += 4; bar2.Marks.Pen.Visible = false; bar2.Marks.Font.Color = Color.White; theDivLine.Marks.Font.Size = 15; theDivLine.Marks.FollowSeriesColor = true; theDivLine.Marks.TailStyle = MarksTail.None; theDivLine.Marks.Pen.Width = 1; theDivLine.Marks.Pen.Color = theDivLine.Color.AddLuminosity(-0.3); BaseChart.Chart.Panel.MarginLeft = 5; ImplementiOSMarks(BaseChart.Chart); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.barSeries1 = new Steema.TeeChart.Styles.Bar(); this.barSeries2 = new Steema.TeeChart.Styles.Bar(); this.divide1 = new Steema.TeeChart.Functions.Divide(); this.lineSeries1 = new Steema.TeeChart.Styles.Line(); this.SuspendLayout(); // // textBox1 // this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(388, 55); this.textBox1.Text = "The Divide function calculates the division of every point of several data source" + " series."; // // panel1 // this.panel1.Location = new System.Drawing.Point(0, 55); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(388, 25); // // tChart1 // // // tChart1.Aspect // this.tChart1.Aspect.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; this.tChart1.Aspect.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; // // tChart1.Header // this.tChart1.Header.Lines = new string[] { "Divide function" }; this.tChart1.Location = new System.Drawing.Point(0, 80); this.tChart1.Name = "tChart1"; // // tChart1.Panel // // // tChart1.Panel.Brush // this.tChart1.Panel.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(254)), ((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(255))); this.tChart1.Series.Add(this.barSeries1); this.tChart1.Series.Add(this.barSeries2); this.tChart1.Series.Add(this.lineSeries1); this.tChart1.Size = new System.Drawing.Size(388, 175); // // tChart1.Walls // // // tChart1.Walls.Bottom // // // tChart1.Walls.Bottom.Pen // this.tChart1.Walls.Bottom.Pen.Visible = false; this.tChart1.Walls.Bottom.Size = 5; // // tChart1.Walls.Left // // // tChart1.Walls.Left.Pen // this.tChart1.Walls.Left.Pen.Visible = false; this.tChart1.Walls.Left.Size = 5; // // barSeries1 // // // barSeries1.Brush // //this.barSeries1.Brush.Color = System.Drawing.Color.Red; // // barSeries1.Marks // // // barSeries1.Marks.Symbol // // // barSeries1.Marks.Symbol.Shadow // this.barSeries1.Marks.Symbol.Shadow.Height = 1; this.barSeries1.Marks.Symbol.Shadow.Visible = true; this.barSeries1.Marks.Symbol.Shadow.Width = 1; this.barSeries1.Title = "Source1"; // // barSeries1.XValues // this.barSeries1.XValues.DataMember = "X"; this.barSeries1.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending; // // barSeries1.YValues // this.barSeries1.YValues.DataMember = "Bar"; // // barSeries2 // // // barSeries2.Brush // //this.barSeries2.Brush.Color = System.Drawing.Color.Green; // // barSeries2.Marks // // // barSeries2.Marks.Symbol // // // barSeries2.Marks.Symbol.Shadow // this.barSeries2.Marks.Symbol.Shadow.Height = 1; this.barSeries2.Marks.Symbol.Shadow.Visible = true; this.barSeries2.Marks.Symbol.Shadow.Width = 1; this.barSeries2.Title = "Source2"; // // barSeries2.XValues // this.barSeries2.XValues.DataMember = "X"; this.barSeries2.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending; // // barSeries2.YValues // this.barSeries2.YValues.DataMember = "Bar"; // // lineSeries1 // // // lineSeries1.Brush // //this.lineSeries1.Brush.Color = System.Drawing.Color.Yellow; this.lineSeries1.DataSource = new object[] { this.barSeries1, this.barSeries2 }; this.lineSeries1.Function = this.divide1; // // lineSeries1.Marks // // // lineSeries1.Marks.Brush // this.lineSeries1.Marks.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(0))); // // lineSeries1.Marks.Font // // // lineSeries1.Marks.Font.Brush // this.lineSeries1.Marks.Font.Brush.Color = System.Drawing.Color.Red; // // lineSeries1.Marks.Symbol // // // lineSeries1.Marks.Symbol.Shadow // this.lineSeries1.Marks.Symbol.Shadow.Height = 1; this.lineSeries1.Marks.Symbol.Shadow.Visible = true; this.lineSeries1.Marks.Symbol.Shadow.Width = 1; this.lineSeries1.Marks.Visible = true; // // lineSeries1.Pointer // this.lineSeries1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Rectangle; this.lineSeries1.Title = "Divide"; // // lineSeries1.XValues // this.lineSeries1.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending; // // Function_Divide // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(388, 255); this.Name = "Function_Divide"; this.ResumeLayout(false); }