示例#1
0
文件: Emt.cs 项目: qwinner/Beijing_SK
 private void button1_Click(object sender, EventArgs e)
 {
     mystyle++;
     tChart1.Series.Clear();
     switch (mystyle)
     {
         case 1:
             Steema.TeeChart.Styles.Area area = new Steema.TeeChart.Styles.Area();
             area.Add(data);
             tChart1.Series.Add(area);
             break;
         case 2:
             Steema.TeeChart.Styles.Arrow arrow= new Steema.TeeChart.Styles.Arrow();
             arrow.Add(data);
             tChart1.Series.Add(arrow);
             break;
         case 3:
             Steema.TeeChart.Styles.Bar Bar = new Steema.TeeChart.Styles.Bar();
             Bar.Add(data);
             tChart1.Series.Add(Bar);
             break;
         case 4:
             Steema.TeeChart.Styles.Bar3D Bar3D = new Steema.TeeChart.Styles.Bar3D();
             Bar3D.Add(data);
             tChart1.Series.Add(Bar3D);
             break;
         case 5:
             Steema.TeeChart.Styles.BarJoin BarJoin = new Steema.TeeChart.Styles.BarJoin();
             BarJoin.Add(data);
             tChart1.Series.Add(BarJoin);
             break;
         case 6:
             Steema.TeeChart.Styles.Bezier Bezier = new Steema.TeeChart.Styles.Bezier();
             Bezier.Add(data);
             tChart1.Series.Add(Bezier);
             break;
     }
     if (mystyle > 10)
         mystyle = 0;
 }
示例#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.bar3DSeries1 = new Steema.TeeChart.Styles.Bar3D();
     this.label1       = new System.Windows.Forms.Label();
     this.comboBox1    = new System.Windows.Forms.ComboBox();
     this.button1      = new System.Windows.Forms.Button();
     this.colorBand1   = new Steema.TeeChart.Tools.ColorBand();
     this.gridBand1    = new Steema.TeeChart.Tools.GridBand();
     this.panel1.SuspendLayout();
     this.SuspendLayout();
     //
     // textBox1
     //
     this.textBox1.Name = "textBox1";
     this.textBox1.Size = new System.Drawing.Size(466, 48);
     this.textBox1.Text = "The Bar 3D series is an extension of Bar series, providing an extra \"Y\" coordinat" +
                          "e for each bar point.";
     //
     // panel1
     //
     this.panel1.Controls.Add(this.button1);
     this.panel1.Controls.Add(this.comboBox1);
     this.panel1.Controls.Add(this.label1);
     this.panel1.Location = new System.Drawing.Point(0, 48);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(466, 40);
     //
     // tChart1
     //
     //
     // tChart1.Aspect
     //
     this.tChart1.Aspect.Chart3DPercent    = 25;
     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[] {
         "Bar 3D series"
     };
     this.tChart1.Location = new System.Drawing.Point(0, 88);
     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.bar3DSeries1);
     this.tChart1.Size = new System.Drawing.Size(466, 198);
     this.tChart1.Tools.Add(this.colorBand1);
     this.tChart1.Tools.Add(this.gridBand1);
     //
     // tChart1.Walls
     //
     //
     // tChart1.Walls.Back
     //
     this.tChart1.Walls.Back.Visible = false;
     //
     // tChart1.Walls.Bottom
     //
     //
     // tChart1.Walls.Bottom.Brush
     //
     this.tChart1.Walls.Bottom.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(178)), ((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(255)));
     //
     // tChart1.Walls.Bottom.Gradient
     //
     this.tChart1.Walls.Bottom.Brush.Gradient.Transparency = 30;
     //
     // tChart1.Walls.Bottom.Gradient
     //
     this.tChart1.Walls.Bottom.Gradient.Transparency = 30;
     //
     // tChart1.Walls.Bottom.Pen
     //
     this.tChart1.Walls.Bottom.Pen.Visible = false;
     this.tChart1.Walls.Bottom.Size        = 3;
     //
     // tChart1.Walls.Left
     //
     //
     // tChart1.Walls.Left.Brush
     //
     this.tChart1.Walls.Left.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(178)), ((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(224)));
     //
     // tChart1.Walls.Left.Gradient
     //
     this.tChart1.Walls.Left.Brush.Gradient.Transparency = 30;
     //
     // tChart1.Walls.Left.Gradient
     //
     this.tChart1.Walls.Left.Gradient.Transparency = 30;
     //
     // tChart1.Walls.Left.Pen
     //
     this.tChart1.Walls.Left.Pen.Visible = false;
     this.tChart1.Walls.Left.Size        = 3;
     //
     // bar3DSeries1
     //
     //
     // bar3DSeries1.Brush
     //
     this.bar3DSeries1.Brush.Color = System.Drawing.Color.Red;
     //
     // bar3DSeries1.Gradient
     //
     this.bar3DSeries1.Brush.Gradient.StartColor = System.Drawing.Color.Yellow;
     this.bar3DSeries1.Brush.Gradient.Visible    = true;
     //
     // bar3DSeries1.Gradient
     //
     this.bar3DSeries1.Gradient.StartColor = System.Drawing.Color.Yellow;
     this.bar3DSeries1.Gradient.Visible    = true;
     this.bar3DSeries1.LabelMember         = "Labels";
     //
     // bar3DSeries1.Marks
     //
     //
     // bar3DSeries1.Marks.Symbol
     //
     //
     // bar3DSeries1.Marks.Symbol.Shadow
     //
     this.bar3DSeries1.Marks.Symbol.Shadow.Height  = 1;
     this.bar3DSeries1.Marks.Symbol.Shadow.Visible = true;
     this.bar3DSeries1.Marks.Symbol.Shadow.Width   = 1;
     //
     // bar3DSeries1.Pen
     //
     this.bar3DSeries1.Pen.Color = System.Drawing.Color.FromArgb(((System.Byte)(254)), ((System.Byte)(64)), ((System.Byte)(64)), ((System.Byte)(0)));
     this.bar3DSeries1.Title     = "bar3DSeries1";
     //
     // bar3DSeries1.XValues
     //
     this.bar3DSeries1.XValues.DataMember = "X";
     this.bar3DSeries1.XValues.Order      = Steema.TeeChart.Styles.ValueListOrder.Ascending;
     //
     // bar3DSeries1.YValues
     //
     this.bar3DSeries1.YValues.DataMember = "Bar";
     //
     // label1
     //
     this.label1.AutoSize  = true;
     this.label1.Location  = new System.Drawing.Point(16, 12);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(36, 16);
     this.label1.TabIndex  = 0;
     this.label1.Text      = "&Style :";
     this.label1.TextAlign = System.Drawing.ContentAlignment.TopRight;
     //
     // comboBox1
     //
     this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     this.comboBox1.Items.AddRange(new object[] {
         "Rectangle",
         "Pyramid",
         "Invert. Pyramid",
         "Cylinder",
         "Ellipse",
         "Arrow",
         "Rect. Gradient",
         "Cone"
     });
     this.comboBox1.Location              = new System.Drawing.Point(60, 10);
     this.comboBox1.Name                  = "comboBox1";
     this.comboBox1.Size                  = new System.Drawing.Size(101, 21);
     this.comboBox1.TabIndex              = 1;
     this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
     //
     // button1
     //
     this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.button1.Location  = new System.Drawing.Point(200, 9);
     this.button1.Name      = "button1";
     this.button1.TabIndex  = 2;
     this.button1.Text      = "&Edit...";
     this.button1.Click    += new System.EventHandler(this.button1_Click);
     //
     // colorBand1
     //
     this.colorBand1.Axis = this.tChart1.Axes.Left;
     //
     // colorBand1.Brush
     //
     this.colorBand1.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(33)), ((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(255)));
     this.colorBand1.End         = 400;
     //
     // colorBand1.Pen
     //
     this.colorBand1.Pen.Color   = System.Drawing.Color.FromArgb(((System.Byte)(254)), ((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(160)));
     this.colorBand1.ResizeEnd   = false;
     this.colorBand1.ResizeStart = false;
     this.colorBand1.Start       = 800;
     //
     // gridBand1
     //
     this.gridBand1.Axis = this.tChart1.Axes.Left;
     //
     // gridBand1.Band1
     //
     this.gridBand1.Band1.Color = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224)));
     //
     // gridBand1.Band2
     //
     this.gridBand1.Band2.Color = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(255)));
     //
     // SeriesType_Bar3D
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(466, 286);
     this.Name  = "SeriesType_Bar3D";
     this.Load += new System.EventHandler(this.SeriesType_Bar3D_Load);
     this.panel1.ResumeLayout(false);
     this.ResumeLayout(false);
 }
示例#3
0
        private void InitChart()
        {
            // Create the Chart
            Chart1 = new TChart();

            // Assign a Rect frame
            Chart1.Frame = this.View.Frame;

            // Creates the AfterDraw Event call
            Chart1.AfterDraw    += new Steema.TeeChart.PaintChartEventHandler(chart_AfterDraw);
            Chart1.GetAxisLabel += Chart1_GetAxisLabel;

            // Adds the Chart view to the Root view
            this.View.AddSubview(Chart1);

            Chart1.Aspect.View3D = false;

            this.Chart1.Axes.Bottom.AxisPen.Visible         = false;
            this.Chart1.Axes.Bottom.Grid.Color              = Color.FromArgb(255, 20, 44, 80);
            this.Chart1.Axes.Bottom.Grid.Style              = Steema.TeeChart.Drawing.DashStyle.Solid;
            this.Chart1.Axes.Bottom.Grid.Width              = 2;
            this.Chart1.Axes.Bottom.Labels.Font.Brush.Color = Color.FromArgb(255, 255, 255, 255);
            this.Chart1.Axes.Bottom.MinorTicks.Visible      = false;
            this.Chart1.Axes.Bottom.TickOnLabelsOnly        = false;
            this.Chart1.Axes.Bottom.Ticks.Visible           = false;
            this.Chart1.Axes.Left.AxisPen.Visible           = false;
            this.Chart1.Axes.Left.Grid.Visible              = false;
            this.Chart1.Axes.Left.Increment = 5D;
            this.Chart1.Axes.Left.Labels.Font.Brush.Color = Color.FromArgb(255, 128, 128, 255);
            this.Chart1.Axes.Left.Labels.Font.Size        = 9;
            this.Chart1.Axes.Left.Labels.Font.SizeFloat   = 9F;
            this.Chart1.Axes.Left.MinorTicks.Visible      = false;
            this.Chart1.Axes.Left.TickOnLabelsOnly        = false;
            this.Chart1.Axes.Left.Ticks.Visible           = false;
            this.Chart1.Header.Font.Brush.Color           = Color.FromArgb(255, 255, 255, 255);
            this.Chart1.Header.Font.Size      = 21;
            this.Chart1.Header.Font.SizeFloat = 21F;
            this.Chart1.Header.Lines          = new string[] {
                "Custom drawing on Chart"
            };

            this.Chart1.Legend.Visible               = false;
            this.Chart1.Panel.Brush.Color            = Color.FromArgb(255, 29, 56, 109);
            this.Chart1.Panel.Brush.Gradient.Visible = false;
            this.Chart1.Panel.MarginLeft             = 22D;

            line1  = new Steema.TeeChart.Styles.Line();
            bar3D1 = new Steema.TeeChart.Styles.Bar3D();
            line2  = new Steema.TeeChart.Styles.Line();

            this.Chart1.Series.Add(this.line1);
            this.Chart1.Series.Add(this.bar3D1);
            this.Chart1.Series.Add(this.line2);
            annotation1 = new Steema.TeeChart.Tools.Annotation();
            annotation2 = new Steema.TeeChart.Tools.Annotation();

            this.Chart1.Tools.Add(this.annotation1);
            this.Chart1.Tools.Add(this.annotation2);
            this.Chart1.Walls.Visible = false;
            // line1
            this.line1.Brush.Color        = Color.FromArgb(255, 255, 255, 255);
            this.line1.Color              = Color.FromArgb(255, 255, 255, 255);
            this.line1.ColorEach          = false;
            this.line1.LinePen.Color      = Color.FromArgb(255, 255, 255, 255);
            this.line1.Pointer.Pen.Color  = Color.FromArgb(255, 29, 56, 109);
            this.line1.Pointer.SizeDouble = 0D;
            this.line1.Pointer.SizeUnits  = Steema.TeeChart.Styles.PointerSizeUnits.Pixels;
            this.line1.Pointer.Style      = Steema.TeeChart.Styles.PointerStyles.Circle;
            this.line1.Pointer.Visible    = true;
            this.line1.Title              = "line1";
            this.line1.XValues.DataMember = "X";
            this.line1.XValues.Order      = Steema.TeeChart.Styles.ValueListOrder.Ascending;
            this.line1.YValues.DataMember = "Y";
            //
            // bar3D1
            this.bar3D1.Brush.Color   = Color.FromArgb(255, 88, 130, 214);
            this.bar3D1.Color         = Color.FromArgb(255, 88, 130, 214);
            this.bar3D1.ColorEach     = false;
            this.bar3D1.Marks.Visible = false;
            this.bar3D1.Pen.Color     = Color.FromArgb(255, 146, 94, 32);
            this.bar3D1.Pen.Visible   = false;
            this.bar3D1.Title         = "bar3D1";
            this.bar3D1.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending;
            //
            // line2
            this.line2.Brush.Color        = Color.FromArgb(255, 255, 255, 255);
            this.line2.Color              = Color.FromArgb(255, 255, 255, 255);
            this.line2.ColorEach          = false;
            this.line2.LinePen.Color      = Color.FromArgb(255, 255, 255, 255);
            this.line2.Pointer.Pen.Color  = Color.FromArgb(255, 29, 56, 109);
            this.line2.Pointer.SizeDouble = 0D;
            this.line2.Pointer.SizeUnits  = Steema.TeeChart.Styles.PointerSizeUnits.Pixels;
            this.line2.Pointer.Style      = Steema.TeeChart.Styles.PointerStyles.Circle;
            this.line2.Pointer.Visible    = true;
            this.line2.Title              = "line2";
            this.line2.XValues.DataMember = "X";
            this.line2.XValues.Order      = Steema.TeeChart.Styles.ValueListOrder.Ascending;
            this.line2.YValues.DataMember = "Y";
            //
            // annotation1
            //
            this.annotation1.AutoSize                   = true;
            this.annotation1.Callout.ArrowHead          = Steema.TeeChart.Styles.ArrowHeadStyles.None;
            this.annotation1.Callout.ArrowHeadDirection = Steema.TeeChart.Styles.ArrowHeadDirection.FromPoint;
            this.annotation1.Callout.ArrowHeadSize      = 8;
            this.annotation1.Callout.Brush.Color        = Color.Black;
            this.annotation1.Callout.Distance           = 0;
            this.annotation1.Callout.Draw3D             = false;
            this.annotation1.Callout.SizeDouble         = 0D;
            this.annotation1.Callout.SizeUnits          = Steema.TeeChart.Styles.PointerSizeUnits.Pixels;
            this.annotation1.Callout.XPosition          = 0;
            this.annotation1.Callout.YPosition          = 0;
            this.annotation1.Callout.ZPosition          = 0;
            this.annotation1.Left                   = 2;
            this.annotation1.Shape.Bottom           = 373;
            this.annotation1.Shape.CustomPosition   = true;
            this.annotation1.Shape.Font.Brush.Color = Color.FromArgb(255, 255, 255, 255);
            this.annotation1.Shape.Font.Size        = 40;
            this.annotation1.Shape.Font.SizeFloat   = 40F;
            this.annotation1.Shape.Left             = 2;
            this.annotation1.Shape.Lines            = new string[] { "40%" };
            this.annotation1.Shape.Right            = 207;
            this.annotation1.Shape.Top              = 25;
            this.annotation1.Shape.Transparent      = true;
            this.annotation1.Text                   = "40%";
            this.annotation1.Top = 70;
            //
            // annotation2
            //
            this.annotation2.AutoSize                   = true;
            this.annotation2.Callout.ArrowHead          = Steema.TeeChart.Styles.ArrowHeadStyles.None;
            this.annotation2.Callout.ArrowHeadDirection = Steema.TeeChart.Styles.ArrowHeadDirection.FromPoint;
            this.annotation2.Callout.ArrowHeadSize      = 8;
            this.annotation2.Callout.Brush.Color        = Color.Black;
            this.annotation2.Callout.Distance           = 0;
            this.annotation2.Callout.Draw3D             = false;
            this.annotation2.Callout.SizeDouble         = 0D;
            this.annotation2.Callout.SizeUnits          = Steema.TeeChart.Styles.PointerSizeUnits.Pixels;
            this.annotation2.Callout.XPosition          = 0;
            this.annotation2.Callout.YPosition          = 0;
            this.annotation2.Callout.ZPosition          = 0;
            this.annotation2.Left                   = 0;
            this.annotation2.Shape.Bottom           = 280;
            this.annotation2.Shape.CustomPosition   = true;
            this.annotation2.Shape.Font.Brush.Color = Color.FromArgb(255, 128, 128, 255);
            this.annotation2.Shape.Font.Size        = 9;
            this.annotation2.Shape.Font.SizeFloat   = 9F;
            this.annotation2.Shape.Left             = 6;
            this.annotation2.Shape.Lines            = new string[] {
                "Percentage",
                "sample data"
            };
            this.annotation2.Shape.Right       = 166;
            this.annotation2.Shape.Top         = 243;
            this.annotation2.Shape.Transparent = true;
            this.annotation2.Text = "Sample\r\ndata";
            this.annotation2.Top  = 120;

            Chart1.Axes.Left.SetMinMax(-20, 33);
            Chart1.Axes.Bottom.SetMinMax(-1, 16);

            bar3D1.Add(0, 26, -11);
            bar3D1.Add(1, 19, -5);
            bar3D1.Add(2, 18.5, -3);
            bar3D1.Add(3, 19, -1);
            bar3D1.Add(4, 17.5, -0.5, "5 jaar");
            bar3D1.Add(5, 15, 2);
            bar3D1.Add(6, 15, 1);
            bar3D1.Add(7, 15, 0.5);
            bar3D1.Add(8, 14.5, 0.5);
            bar3D1.Add(9, 13, 1, "10 jaar");
            bar3D1.Add(10, 12.5, 1.5);
            bar3D1.Add(11, 12.2, 1.5);
            bar3D1.Add(12, 9, 2.2);
            bar3D1.Add(13, 9, 3);
            bar3D1.Add(14, 7, 3.3, "15 jaar");

            double[] xses = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 };

            double[] firstLine  = { 31, 23, 22, 22.5, 20.5, 19, 18, 17, 16.5, 15.5, 14.9, 13.9, 13, 13.5, 13.2 };
            double[] secondLine = { -19.5, -13, -8, -3, -2, -0.5, -0.6, -1.5, -1, 0, 0.4, 0.2, 1.7, 2.2, 2.7 };

            line1.Add(xses, firstLine);
            line2.Add(xses, secondLine);
        }