Example #1
0
        public SubtStdFunctionsChart(ChartView BaseChart)
        {
            subtFunction = new Steema.TeeChart.Functions.Subtract();
            bar1         = new Bar();
            bar2         = new Bar();
            theSubtLine  = new Line();
            var          = new Variables.Variables();

            for (int i = 0; i < var.GetValorStdSubs1.Length; i++)
            {
                bar1.Add(i, var.GetValorStdSubs1[i]);
            }
            for (int i = 0; i < var.GetValorStdSubs2.Length; i++)
            {
                bar2.Add(i, var.GetValorStdSubs2[i]);
            }

            BaseChart.Chart.Series.Add(bar1);
            BaseChart.Chart.Series.Add(bar2);
            BaseChart.Chart.Series.Add(theSubtLine);

            theSubtLine.Function   = subtFunction;
            theSubtLine.DataSource = new object[] { bar1, bar2 };

            bar1.Title         = "Data 1";
            bar1.MarksOnBar    = true;
            bar1.MarksLocation = MarksLocation.Start;
            bar1.SeriesColor   = var.GetPaletteBasic[0];

            bar2.Title         = "Data 2";
            bar2.MarksOnBar    = true;
            bar2.MarksLocation = MarksLocation.Start;
            bar2.SeriesColor   = var.GetPaletteBasic[1];

            theSubtLine.Title                  = "Subtract";
            theSubtLine.LinePen.Width          = 6;
            theSubtLine.Pointer.Style          = PointerStyles.Sphere;
            theSubtLine.Pointer.InflateMargins = true;
            theSubtLine.Pointer.HorizSize      = 5;
            theSubtLine.Pointer.VertSize       = 5;
            theSubtLine.TreatNulls             = TreatNullsStyle.DoNotPaint;
            theSubtLine.Pointer.Visible        = true;
            theSubtLine.Marks.Visible          = true;
            theSubtLine.SeriesColor            = var.GetPaletteBasic[2];

            BaseChart.Chart.Axes.Left.SetMinMax(BaseChart.Chart.Axes.Left.MinYValue + 0.3, BaseChart.Chart.Axes.Left.MaxYValue + 3);
            BaseChart.Chart.Axes.Bottom.SetMinMax(BaseChart.Chart.Axes.Bottom.MinXValue, BaseChart.Chart.Axes.Bottom.MaxXValue);
            BaseChart.Chart.Axes.Left.Increment        = 10;
            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;

            Themes.AplicarMarksTheme1(BaseChart);

            BaseChart.Chart.Series[0].Marks.Font.Size = 14;
            BaseChart.Chart.Series[1].Marks.Font.Size = 14;

            bar1.Marks.Pen.Visible = false;
            bar2.Marks.Pen.Visible = false;

            bar1.Marks.TailStyle = MarksTail.None;
            bar2.Marks.TailStyle = MarksTail.None;

            BaseChart.Chart.Series[0].Marks.TextAlign = TextAlignment.Center;
            BaseChart.Chart.Series[0].Marks.AutoSize  = true;
            BaseChart.Chart.Series[0].Marks.Color     = Xamarin.Forms.Color.Transparent;
            BaseChart.Chart.Series[1].Marks.TextAlign = TextAlignment.Center;
            BaseChart.Chart.Series[1].Marks.AutoSize  = true;
            BaseChart.Chart.Series[1].Marks.Color     = Xamarin.Forms.Color.Transparent;
            BaseChart.Chart.Series[2].Marks.TailStyle = MarksTail.None;
            BaseChart.Chart.Panel.MarginLeft          = 5;
        }
Example #2
0
 /// <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.subtract1   = new Steema.TeeChart.Functions.Subtract();
     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 Subtract function uses more than one series as data source. It calculates for" +
                          " each point the difference between the last and first series.";
     //
     // panel1
     //
     this.panel1.Location = new System.Drawing.Point(0, 55);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(388, 51);
     //
     // 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[] {
         "Subtract funcion"
     };
     this.tChart1.Location = new System.Drawing.Point(0, 106);
     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, 149);
     //
     // 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.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(255)));
     //
     // 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.Green;
     this.lineSeries1.DataSource = new object[] {
         this.barSeries1,
         this.barSeries2
     };
     this.lineSeries1.Function = this.subtract1;
     //
     // lineSeries1.Marks
     //
     //
     // lineSeries1.Marks.Brush
     //
     this.lineSeries1.Marks.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(128)), ((System.Byte)(0)));
     //
     // lineSeries1.Marks.Font
     //
     //
     // lineSeries1.Marks.Font.Brush
     //
     this.lineSeries1.Marks.Font.Brush.Color = System.Drawing.Color.White;
     this.lineSeries1.Marks.Font.Size        = 7;
     //
     // 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         = "Subtract";
     //
     // lineSeries1.XValues
     //
     this.lineSeries1.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending;
     //
     // Function_Subtract
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(388, 255);
     this.Name = "Function_Subtract";
     this.ResumeLayout(false);
 }