Ejemplo n.º 1
0
        private Series CreateSeriesType(DataTable dt, string Name, string XValues, string YValues, string Label)
        {
            Series series;

            switch (this._Type)
            {
            case ChartType.Bar:
                series = new Bar();
                break;

            case ChartType.Pie:
                series = new Pie();
                break;

            case ChartType.Area:
                series = new Area();
                break;

            default:
                series = new Steema.TeeChart.Styles.Line();
                break;
            }
            series.Title              = Name;
            series.DataSource         = dt;
            series.XValues.DataMember = XValues;
            series.XValues.Order      = ValueListOrder.Ascending;
            series.YValues.DataMember = YValues;
            series.YValues.Order      = ValueListOrder.None;
            return(series);
        }
Ejemplo n.º 2
0
        public Line AddLineSeries(TChart objChart, string p_SeriesName, VerticalAxis p_VertAxis,
                                  Color p_seriesColor, bool p_IsDateTime, bool p_showInLegend, bool pointVisible,
                                  System.Drawing.Drawing2D.DashStyle p_lineStyle, int p_lineWidth)
        {
            Steema.TeeChart.Styles.Line lineSeries = new Steema.TeeChart.Styles.Line();
            objChart.Series.Add(lineSeries);

            lineSeries.VertAxis         = p_VertAxis;
            lineSeries.XValues.DateTime = p_IsDateTime;
            lineSeries.Title            = p_SeriesName;
            lineSeries.Marks.Visible    = false;
            lineSeries.ShowInLegend     = p_showInLegend;
            lineSeries.Color            = p_seriesColor;

            // Line-Point Display
            lineSeries.Pointer.Visible     = pointVisible;
            lineSeries.Pointer.Style       = PointerStyles.Circle;
            lineSeries.Pointer.Pen.Visible = false;
            lineSeries.Pointer.HorizSize   = 3;
            lineSeries.Pointer.VertSize    = 3;

            lineSeries.LinePen.Style = p_lineStyle;
            lineSeries.LinePen.Width = p_lineWidth;

            return(lineSeries);
        }
        private void DoDashTrend(Chart tChart1, Chart tChart2)
        {
            tChart1.Panel.MarginLeft = 10;
            tChart2.Panel.MarginLeft = 10;

            tChart1.Axes.Left.Title.Text        = AppResources.Participation;
            tChart1.Axes.Left.Labels.Size.Width = 5;
            tChart2.Axes.Left.Labels.Size.Width = 5;
            tChart2.Axes.Left.Title.Text        = AppResources.DollarValue;
            tChart1.Series.Clear();
            tChart2.Series.Clear();
            Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line();
            Steema.TeeChart.Styles.Line line2 = new Steema.TeeChart.Styles.Line();
            tChart1.Series.Clear();
            tChart1.Series.Add(line1);
            tChart1.Series.Add(line2);
            line1.LinePen.Width = 4;
            line2.LinePen.Width = 4;
            line1.FillSampleValues(20);
            line2.FillSampleValues(20);

            line1.Smoothed = true;
            line2.Smoothed = true;

            Steema.TeeChart.Styles.Area area1  = new Steema.TeeChart.Styles.Area();
            Steema.TeeChart.Styles.Area area2  = new Steema.TeeChart.Styles.Area();
            Steema.TeeChart.Styles.Line movAvg = new Steema.TeeChart.Styles.Line();

            Steema.TeeChart.Functions.MovingAverage movAvgFunc =
                new Steema.TeeChart.Functions.MovingAverage(tChart2.Chart);

            movAvgFunc.PeriodStyle = Steema.TeeChart.Functions.PeriodStyles.NumPoints;
            movAvgFunc.Period      = 4;
            movAvg.Function        = movAvgFunc;
            movAvg.DataSource      = area2;
            movAvg.LinePen.Width   = 4;
            movAvg.Smoothed        = true;

            tChart2.Series.Add(area1);
            tChart2.Series.Add(area2);
            tChart2.Series.Add(movAvg);

            //tChart2.AfterDraw+=new PaintChartEventHandler(tChart2_AfterDraw);

            movAvg.AfterDrawValues += new PaintChartEventHandler(movAvg_AfterDrawValues);

            area1.Transparency = 35;
            area2.Transparency = 35;
            area1.FillSampleValues(20);
            area2.FillSampleValues(20);

            tChart2.Legend.Visible     = true;
            tChart2.Legend.Font.Size   = 12;
            tChart2.Legend.LegendStyle = LegendStyles.Values;
            tChart2.Legend.MaxNumRows  = 2;
            tChart2.Legend.Alignment   = LegendAlignments.Bottom;
            //}
        }
        private void InitializeChart()
        {
            tChart1.Aspect.View3D                  = false;
            tChart1.Legend.Visible                 = false;
            tChart1.Header.Font.Color              = Color.FromArgb(154, 154, 154);
            tChart1.Header.Text                    = "Euribor";
            tChart1.Panel.Bevel.Inner              = BevelStyles.None;
            tChart1.Panel.Bevel.Outer              = BevelStyles.None;
            tChart1.Panel.Color                    = Color.White;
            tChart1.Panel.Gradient.Visible         = false;
            tChart1.Axes.Left.AxisPen.Color        = Color.FromArgb(120, 60, 20);
            tChart1.Axes.Left.AxisPen.Width        = 4;
            tChart1.Axes.Left.MinorTicks.Visible   = false;
            tChart1.Axes.Left.Grid.Color           = Color.FromArgb(245, 225, 170);
            tChart1.Axes.Left.Grid.Style           = System.Drawing.Drawing2D.DashStyle.Solid;
            tChart1.Axes.Bottom.AxisPen.Color      = Color.FromArgb(120, 60, 20);
            tChart1.Axes.Bottom.Grid.Visible       = false;
            tChart1.Axes.Bottom.MinorTicks.Visible = false;
            tChart1.Axes.Bottom.AxisPen.Width      = 4;
            tChart1.Walls.Back.Pen.Visible         = false;
            tChart1.Walls.Back.Gradient.Visible    = false;
            tChart1.Walls.Back.Color               = Color.White;

            Steema.TeeChart.Styles.Line series1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            series1.Color           = Color.FromArgb(128, 128, 128);
            series1.Pointer.Style   = PointerStyles.Circle;
            series1.Pointer.Visible = true;

            series1.Add(5.323, "08-Aug");
            series1.Add(5.384, "08-Sep");
            series1.Add(5.248, "08-Oct");
            series1.Add(4.350, "08-Nov");
            series1.Add(3.452, "08-Dec");
            series1.Add(2.622, "09-Jan");
            series1.Add(2.135, "09-Feb");

            Steema.TeeChart.Tools.SeriesRegionTool region = new Steema.TeeChart.Tools.SeriesRegionTool(tChart1.Chart);
            region.Color        = Color.FromArgb(225, 225, 255);
            region.Transparency = 50;
            region.Series       = series1;

            Steema.TeeChart.Tools.MarksTip markstip = new MarksTip(tChart1.Chart);
            markstip.Series = series1;
#if VS2005
            markstip.BackColor = Color.White;
#endif
            markstip.Style = MarksStyles.Value;


            Steema.TeeChart.Animations.Expand expand;
            tChart1.Animations.Add(expand = new Steema.TeeChart.Animations.Expand());
            expand.Target  = ChartClickedPartStyle.SeriesPointer;
            expand.Trigger = Steema.TeeChart.Animations.AnimationTrigger.MouseOver;
        }
Ejemplo n.º 5
0
 private Series GetSeries(string Title)
 {
     foreach (Series S in Chart.Series)
     {
         if (S.Title == Title)
         {
             return(S);
         }
     }
     // Not found so create a new one.
     Steema.TeeChart.Styles.Line NewSeries = new Steema.TeeChart.Styles.Line();
     NewSeries.Title = Title;
     Chart.Series.Add(NewSeries);
     return(NewSeries);
 }
Ejemplo n.º 6
0
        private void ReadSeries()
        {
            int sz = hydrometDataTable.Columns.Count;



            tChart1.Series.Clear();
            tChart1.Zoom.Undo();
            InitAxis();
            tChart1.Panel.MarginLeft  = 10;
            tChart1.Panel.MarginUnits = Steema.TeeChart.PanelMarginUnits.Percent;
            TChartDataLoader loader = new TChartDataLoader(this.tChart1);

            for (int i = 1; i < sz; i += 1)
            {
                try
                {
                    string columnName = hydrometDataTable.Columns[i].ColumnName;
                    Steema.TeeChart.Styles.Line series = loader.CreateSeries(hydrometDataTable, columnName, Reclamation.TimeSeries.TimeInterval.Daily, true);

                    series.VertAxis        = Steema.TeeChart.Styles.VerticalAxis.Left;
                    series.Pointer.Visible = true;

                    var    tokens = TextFile.Split(columnName);
                    string pcode  = "";
                    string cbtt   = "";
                    if (tokens.Length == 2)
                    {
                        cbtt  = tokens[0].Trim();
                        pcode = tokens[1].Trim();
                    }

                    SetAxis(series, pcode);

                    tChart1.Series.Add(series);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString() + " series index " + i);
                    Logger.WriteLine(ex.ToString(), "ui");
                }
            }

            tChart1.Axes.Left.Automatic = true;
        }
Ejemplo n.º 7
0
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            tChart1.Header.Text   = "Canvas ICloneable Implementation";
            annotation1           = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);
            annotation1.Text      = "Click on me!";
            annotation1.Position  = Steema.TeeChart.Tools.AnnotationPositions.LeftTop;
            line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            line1.FillSampleValues();
            selector1           = new Steema.TeeChart.Tools.Selector(tChart1.Chart);
            selector1.AllowDrag = false;
            selector1.Selected += new Steema.TeeChart.Tools.SelectorSelectedEventHandler(selector1_Selected);

            tChart1.Axes.Left.Grid.Visible   = false;
            tChart1.Axes.Bottom.Grid.Visible = false;

            tChart1.KeyDown   += new KeyEventHandler(tChart1_KeyDown);
            tChart1.AfterDraw += new PaintChartEventHandler(tChart1_AfterDraw);
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components    = new System.ComponentModel.Container();
     this.splitter1     = new System.Windows.Forms.Splitter();
     this.chartListBox1 = new Steema.TeeChart.ChartListBox(this.components);
     this.tChart1       = new Steema.TeeChart.TChart();
     this.area1         = new Steema.TeeChart.Styles.Area();
     this.bar1          = new Steema.TeeChart.Styles.Bar();
     this.line1         = new Steema.TeeChart.Styles.Line();
     this.points1       = new Steema.TeeChart.Styles.Points();
     this.groupBox1     = new System.Windows.Forms.GroupBox();
     this.radioButton2  = new System.Windows.Forms.RadioButton();
     this.radioButton1  = new System.Windows.Forms.RadioButton();
     this.panel1.SuspendLayout();
     this.panel2.SuspendLayout();
     this.groupBox1.SuspendLayout();
     this.SuspendLayout();
     //
     // textBox1
     //
     this.textBox1.Name = "textBox1";
     this.textBox1.Text = "Chart ListBox control supports displaying check-boxes and radio-buttons.\r\nThe mai" +
                          "n purpose of radio-buttons is to show only one series at a time.\r\n\r\nChartListBox" +
                          "1.CheckStyle = CheckBoxStyle.Radio; ";
     //
     // panel1
     //
     this.panel1.Controls.Add(this.groupBox1);
     this.panel1.Name = "panel1";
     //
     // panel2
     //
     this.panel2.Controls.Add(this.tChart1);
     this.panel2.Controls.Add(this.chartListBox1);
     this.panel2.Controls.Add(this.splitter1);
     this.panel2.Name = "panel2";
     //
     // splitter1
     //
     this.splitter1.Location = new System.Drawing.Point(0, 0);
     this.splitter1.Name     = "splitter1";
     this.splitter1.Size     = new System.Drawing.Size(120, 154);
     this.splitter1.TabIndex = 0;
     this.splitter1.TabStop  = false;
     //
     // chartListBox1
     //
     this.chartListBox1.AllowDrop = true;
     this.chartListBox1.Anchor    = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                           | System.Windows.Forms.AnchorStyles.Left)
                                                                          | System.Windows.Forms.AnchorStyles.Right)));
     this.chartListBox1.Chart      = this.tChart1;
     this.chartListBox1.Location   = new System.Drawing.Point(0, 0);
     this.chartListBox1.Name       = "chartListBox1";
     this.chartListBox1.OtherItems = null;
     this.chartListBox1.Size       = new System.Drawing.Size(120, 172);
     this.chartListBox1.TabIndex   = 1;
     //
     // tChart1
     //
     //
     // tChart1.Aspect
     //
     this.tChart1.Aspect.SmoothingMode     = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
     this.tChart1.Aspect.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
     this.tChart1.Aspect.ThemeIndex        = 2;
     //
     // tChart1.Axes
     //
     //
     // tChart1.Axes.Bottom
     //
     //
     // tChart1.Axes.Bottom.AxisPen
     //
     this.tChart1.Axes.Bottom.AxisPen.Width = 1;
     //
     // tChart1.Axes.Bottom.Grid
     //
     this.tChart1.Axes.Bottom.Grid.Centered = true;
     this.tChart1.Axes.Bottom.Grid.Color    = System.Drawing.Color.Black;
     this.tChart1.Axes.Bottom.Grid.Style    = System.Drawing.Drawing2D.DashStyle.Solid;
     //
     // tChart1.Axes.Bottom.Labels
     //
     //
     // tChart1.Axes.Bottom.Labels.Font
     //
     this.tChart1.Axes.Bottom.Labels.Font.Bold = true;
     this.tChart1.Axes.Bottom.Labels.Font.Name = "Times New Roman";
     this.tChart1.Axes.Bottom.Labels.Font.Size = 10;
     //
     // tChart1.Axes.Bottom.MinorGrid
     //
     this.tChart1.Axes.Bottom.MinorGrid.Color = System.Drawing.Color.FromArgb(((System.Byte)(229)), ((System.Byte)(229)), ((System.Byte)(229)));
     //
     // tChart1.Axes.Bottom.MinorTicks
     //
     this.tChart1.Axes.Bottom.MinorTicks.Color   = System.Drawing.Color.Black;
     this.tChart1.Axes.Bottom.MinorTicks.Visible = false;
     //
     // tChart1.Axes.Bottom.Ticks
     //
     this.tChart1.Axes.Bottom.Ticks.Color  = System.Drawing.Color.Black;
     this.tChart1.Axes.Bottom.Ticks.Length = 2;
     //
     // tChart1.Axes.Bottom.TicksInner
     //
     this.tChart1.Axes.Bottom.TicksInner.Color   = System.Drawing.Color.Black;
     this.tChart1.Axes.Bottom.TicksInner.Visible = false;
     //
     // tChart1.Axes.Bottom.Title
     //
     //
     // tChart1.Axes.Bottom.Title.Font
     //
     this.tChart1.Axes.Bottom.Title.Font.Name = "Times New Roman";
     //
     // tChart1.Axes.Depth
     //
     //
     // tChart1.Axes.Depth.AxisPen
     //
     this.tChart1.Axes.Depth.AxisPen.Width = 1;
     //
     // tChart1.Axes.Depth.Grid
     //
     this.tChart1.Axes.Depth.Grid.Color = System.Drawing.Color.Black;
     this.tChart1.Axes.Depth.Grid.Style = System.Drawing.Drawing2D.DashStyle.Solid;
     //
     // tChart1.Axes.Depth.Labels
     //
     //
     // tChart1.Axes.Depth.Labels.Font
     //
     this.tChart1.Axes.Depth.Labels.Font.Name = "Times New Roman";
     this.tChart1.Axes.Depth.Labels.Font.Size = 10;
     //
     // tChart1.Axes.Depth.MinorTicks
     //
     this.tChart1.Axes.Depth.MinorTicks.Color   = System.Drawing.Color.Black;
     this.tChart1.Axes.Depth.MinorTicks.Visible = false;
     //
     // tChart1.Axes.Depth.Ticks
     //
     this.tChart1.Axes.Depth.Ticks.Color  = System.Drawing.Color.Black;
     this.tChart1.Axes.Depth.Ticks.Length = 2;
     //
     // tChart1.Axes.Depth.TicksInner
     //
     this.tChart1.Axes.Depth.TicksInner.Color   = System.Drawing.Color.Black;
     this.tChart1.Axes.Depth.TicksInner.Visible = false;
     //
     // tChart1.Axes.Depth.Title
     //
     //
     // tChart1.Axes.Depth.Title.Font
     //
     this.tChart1.Axes.Depth.Title.Font.Name = "Times New Roman";
     //
     // tChart1.Axes.Left
     //
     //
     // tChart1.Axes.Left.AxisPen
     //
     this.tChart1.Axes.Left.AxisPen.Width = 1;
     //
     // tChart1.Axes.Left.Grid
     //
     this.tChart1.Axes.Left.Grid.Color = System.Drawing.Color.Black;
     this.tChart1.Axes.Left.Grid.Style = System.Drawing.Drawing2D.DashStyle.Solid;
     //
     // tChart1.Axes.Left.Labels
     //
     //
     // tChart1.Axes.Left.Labels.Font
     //
     this.tChart1.Axes.Left.Labels.Font.Bold = true;
     this.tChart1.Axes.Left.Labels.Font.Name = "Times New Roman";
     this.tChart1.Axes.Left.Labels.Font.Size = 10;
     //
     // tChart1.Axes.Left.MinorTicks
     //
     this.tChart1.Axes.Left.MinorTicks.Color   = System.Drawing.Color.Black;
     this.tChart1.Axes.Left.MinorTicks.Visible = false;
     //
     // tChart1.Axes.Left.Ticks
     //
     this.tChart1.Axes.Left.Ticks.Color  = System.Drawing.Color.Black;
     this.tChart1.Axes.Left.Ticks.Length = 2;
     //
     // tChart1.Axes.Left.TicksInner
     //
     this.tChart1.Axes.Left.TicksInner.Color   = System.Drawing.Color.Black;
     this.tChart1.Axes.Left.TicksInner.Visible = false;
     //
     // tChart1.Axes.Left.Title
     //
     //
     // tChart1.Axes.Left.Title.Font
     //
     this.tChart1.Axes.Left.Title.Font.Name = "Times New Roman";
     //
     // tChart1.Axes.Right
     //
     //
     // tChart1.Axes.Right.AxisPen
     //
     this.tChart1.Axes.Right.AxisPen.Width = 1;
     //
     // tChart1.Axes.Right.Grid
     //
     this.tChart1.Axes.Right.Grid.Color = System.Drawing.Color.Black;
     this.tChart1.Axes.Right.Grid.Style = System.Drawing.Drawing2D.DashStyle.Solid;
     //
     // tChart1.Axes.Right.Labels
     //
     //
     // tChart1.Axes.Right.Labels.Font
     //
     this.tChart1.Axes.Right.Labels.Font.Name = "Times New Roman";
     this.tChart1.Axes.Right.Labels.Font.Size = 10;
     //
     // tChart1.Axes.Right.MinorTicks
     //
     this.tChart1.Axes.Right.MinorTicks.Color   = System.Drawing.Color.Black;
     this.tChart1.Axes.Right.MinorTicks.Visible = false;
     //
     // tChart1.Axes.Right.Ticks
     //
     this.tChart1.Axes.Right.Ticks.Color  = System.Drawing.Color.Black;
     this.tChart1.Axes.Right.Ticks.Length = 2;
     //
     // tChart1.Axes.Right.TicksInner
     //
     this.tChart1.Axes.Right.TicksInner.Color   = System.Drawing.Color.Black;
     this.tChart1.Axes.Right.TicksInner.Visible = false;
     //
     // tChart1.Axes.Right.Title
     //
     //
     // tChart1.Axes.Right.Title.Font
     //
     this.tChart1.Axes.Right.Title.Font.Name = "Times New Roman";
     //
     // tChart1.Axes.Top
     //
     //
     // tChart1.Axes.Top.AxisPen
     //
     this.tChart1.Axes.Top.AxisPen.Width = 1;
     //
     // tChart1.Axes.Top.Grid
     //
     this.tChart1.Axes.Top.Grid.Color = System.Drawing.Color.Black;
     this.tChart1.Axes.Top.Grid.Style = System.Drawing.Drawing2D.DashStyle.Solid;
     //
     // tChart1.Axes.Top.Labels
     //
     //
     // tChart1.Axes.Top.Labels.Font
     //
     this.tChart1.Axes.Top.Labels.Font.Name = "Times New Roman";
     this.tChart1.Axes.Top.Labels.Font.Size = 10;
     //
     // tChart1.Axes.Top.MinorTicks
     //
     this.tChart1.Axes.Top.MinorTicks.Color   = System.Drawing.Color.Black;
     this.tChart1.Axes.Top.MinorTicks.Visible = false;
     //
     // tChart1.Axes.Top.Ticks
     //
     this.tChart1.Axes.Top.Ticks.Color  = System.Drawing.Color.Black;
     this.tChart1.Axes.Top.Ticks.Length = 2;
     //
     // tChart1.Axes.Top.TicksInner
     //
     this.tChart1.Axes.Top.TicksInner.Color   = System.Drawing.Color.Black;
     this.tChart1.Axes.Top.TicksInner.Visible = false;
     //
     // tChart1.Axes.Top.Title
     //
     //
     // tChart1.Axes.Top.Title.Font
     //
     this.tChart1.Axes.Top.Title.Font.Name = "Times New Roman";
     this.tChart1.Dock = System.Windows.Forms.DockStyle.Fill;
     //
     // tChart1.Header
     //
     //
     // tChart1.Header.Brush
     //
     this.tChart1.Header.Brush.Color = System.Drawing.Color.White;
     //
     // tChart1.Header.Gradient
     //
     this.tChart1.Header.Brush.Gradient.EndColor    = System.Drawing.Color.Gray;
     this.tChart1.Header.Brush.Gradient.MiddleColor = System.Drawing.Color.Empty;
     this.tChart1.Header.Brush.Gradient.StartColor  = System.Drawing.Color.White;
     this.tChart1.Header.Brush.Gradient.Visible     = true;
     //
     // tChart1.Header.Font
     //
     //
     // tChart1.Header.Font.Brush
     //
     this.tChart1.Header.Font.Brush.Color = System.Drawing.Color.Black;
     this.tChart1.Header.Font.Name        = "Times New Roman";
     this.tChart1.Header.Font.Size        = 12;
     //
     // tChart1.Header.Gradient
     //
     this.tChart1.Header.Gradient.EndColor    = System.Drawing.Color.Gray;
     this.tChart1.Header.Gradient.MiddleColor = System.Drawing.Color.Empty;
     this.tChart1.Header.Gradient.StartColor  = System.Drawing.Color.White;
     this.tChart1.Header.Gradient.Visible     = true;
     this.tChart1.Header.Lines = new string[] {
         "TeeChart"
     };
     //
     // tChart1.Header.Pen
     //
     this.tChart1.Header.Pen.Width = 2;
     //
     // tChart1.Header.Shadow
     //
     //
     // tChart1.Header.Shadow.Brush
     //
     this.tChart1.Header.Shadow.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(76)), ((System.Byte)(169)), ((System.Byte)(169)), ((System.Byte)(169)));
     this.tChart1.Header.Shadow.Height      = 4;
     this.tChart1.Header.Shadow.Width       = 4;
     this.tChart1.Header.Visible            = false;
     //
     // tChart1.Legend
     //
     //
     // tChart1.Legend.Brush
     //
     //
     // tChart1.Legend.Gradient
     //
     this.tChart1.Legend.Brush.Gradient.EndColor    = System.Drawing.Color.Yellow;
     this.tChart1.Legend.Brush.Gradient.MiddleColor = System.Drawing.Color.Empty;
     this.tChart1.Legend.Brush.Gradient.StartColor  = System.Drawing.Color.White;
     //
     // tChart1.Legend.DividingLines
     //
     this.tChart1.Legend.DividingLines.Color = System.Drawing.Color.Silver;
     //
     // tChart1.Legend.Font
     //
     //
     // tChart1.Legend.Font.Brush
     //
     this.tChart1.Legend.Font.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(100)), ((System.Byte)(0)), ((System.Byte)(0)));
     this.tChart1.Legend.Font.Name        = "Times New Roman";
     this.tChart1.Legend.Font.Size        = 10;
     //
     // tChart1.Legend.Gradient
     //
     this.tChart1.Legend.Gradient.EndColor    = System.Drawing.Color.Yellow;
     this.tChart1.Legend.Gradient.MiddleColor = System.Drawing.Color.Empty;
     this.tChart1.Legend.Gradient.StartColor  = System.Drawing.Color.White;
     //
     // tChart1.Legend.Pen
     //
     this.tChart1.Legend.Pen.Visible = false;
     //
     // tChart1.Legend.Shadow
     //
     //
     // tChart1.Legend.Shadow.Brush
     //
     this.tChart1.Legend.Shadow.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(254)), ((System.Byte)(169)), ((System.Byte)(169)), ((System.Byte)(169)));
     this.tChart1.Legend.Shadow.Height      = 0;
     this.tChart1.Legend.Shadow.Width       = 0;
     //
     // tChart1.Legend.Symbol
     //
     this.tChart1.Legend.Symbol.DefaultPen = false;
     //
     // tChart1.Legend.Symbol.Pen
     //
     this.tChart1.Legend.Symbol.Pen.Visible = false;
     this.tChart1.Legend.Symbol.Squared     = true;
     this.tChart1.Legend.Transparent        = true;
     this.tChart1.Location = new System.Drawing.Point(120, 0);
     this.tChart1.Name     = "tChart1";
     //
     // tChart1.Panel
     //
     //
     // tChart1.Panel.Bevel
     //
     this.tChart1.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
     //
     // tChart1.Panel.Brush
     //
     this.tChart1.Panel.Brush.Color = System.Drawing.Color.White;
     //
     // tChart1.Panel.Gradient
     //
     this.tChart1.Panel.Brush.Gradient.EndColor    = System.Drawing.Color.Yellow;
     this.tChart1.Panel.Brush.Gradient.MiddleColor = System.Drawing.Color.Empty;
     this.tChart1.Panel.Brush.Gradient.StartColor  = System.Drawing.Color.White;
     //
     // tChart1.Panel.Gradient
     //
     this.tChart1.Panel.Gradient.EndColor    = System.Drawing.Color.Yellow;
     this.tChart1.Panel.Gradient.MiddleColor = System.Drawing.Color.Empty;
     this.tChart1.Panel.Gradient.StartColor  = System.Drawing.Color.White;
     //
     // tChart1.Panel.Pen
     //
     this.tChart1.Panel.Pen.Visible = true;
     //
     // tChart1.Panel.Shadow
     //
     //
     // tChart1.Panel.Shadow.Brush
     //
     this.tChart1.Panel.Shadow.Brush.Color = System.Drawing.Color.Black;
     this.tChart1.Panel.Shadow.Height      = 0;
     this.tChart1.Panel.Shadow.Visible     = true;
     this.tChart1.Panel.Shadow.Width       = 0;
     this.tChart1.Series.Add(this.area1);
     this.tChart1.Series.Add(this.bar1);
     this.tChart1.Series.Add(this.line1);
     this.tChart1.Series.Add(this.points1);
     this.tChart1.Size     = new System.Drawing.Size(306, 154);
     this.tChart1.TabIndex = 2;
     //
     // tChart1.Walls
     //
     //
     // tChart1.Walls.Back
     //
     this.tChart1.Walls.Back.ApplyDark = false;
     //
     // tChart1.Walls.Back.Brush
     //
     this.tChart1.Walls.Back.Brush.Color = System.Drawing.Color.White;
     //
     // tChart1.Walls.Back.Gradient
     //
     this.tChart1.Walls.Back.Brush.Gradient.EndColor    = System.Drawing.Color.FromArgb(((System.Byte)(223)), ((System.Byte)(122)), ((System.Byte)(41)));
     this.tChart1.Walls.Back.Brush.Gradient.MiddleColor = System.Drawing.Color.Empty;
     this.tChart1.Walls.Back.Brush.Gradient.StartColor  = System.Drawing.Color.White;
     //
     // tChart1.Walls.Back.Gradient
     //
     this.tChart1.Walls.Back.Gradient.EndColor    = System.Drawing.Color.FromArgb(((System.Byte)(223)), ((System.Byte)(122)), ((System.Byte)(41)));
     this.tChart1.Walls.Back.Gradient.MiddleColor = System.Drawing.Color.Empty;
     this.tChart1.Walls.Back.Gradient.StartColor  = System.Drawing.Color.White;
     this.tChart1.Walls.Back.Size        = 8;
     this.tChart1.Walls.Back.Transparent = false;
     //
     // tChart1.Walls.Bottom
     //
     this.tChart1.Walls.Bottom.ApplyDark = false;
     //
     // tChart1.Walls.Bottom.Brush
     //
     //
     // tChart1.Walls.Bottom.Gradient
     //
     this.tChart1.Walls.Bottom.Brush.Gradient.EndColor   = System.Drawing.Color.FromArgb(((System.Byte)(252)), ((System.Byte)(254)), ((System.Byte)(253)));
     this.tChart1.Walls.Bottom.Brush.Gradient.StartColor = System.Drawing.Color.FromArgb(((System.Byte)(47)), ((System.Byte)(133)), ((System.Byte)(253)));
     //
     // tChart1.Walls.Bottom.Gradient
     //
     this.tChart1.Walls.Bottom.Gradient.EndColor   = System.Drawing.Color.FromArgb(((System.Byte)(252)), ((System.Byte)(254)), ((System.Byte)(253)));
     this.tChart1.Walls.Bottom.Gradient.StartColor = System.Drawing.Color.FromArgb(((System.Byte)(47)), ((System.Byte)(133)), ((System.Byte)(253)));
     this.tChart1.Walls.Bottom.Size = 8;
     //
     // tChart1.Walls.Left
     //
     this.tChart1.Walls.Left.ApplyDark = false;
     //
     // tChart1.Walls.Left.Brush
     //
     this.tChart1.Walls.Left.Brush.Color = System.Drawing.Color.White;
     //
     // tChart1.Walls.Left.Gradient
     //
     this.tChart1.Walls.Left.Brush.Gradient.EndColor   = System.Drawing.Color.FromArgb(((System.Byte)(36)), ((System.Byte)(209)), ((System.Byte)(252)));
     this.tChart1.Walls.Left.Brush.Gradient.StartColor = System.Drawing.Color.FromArgb(((System.Byte)(13)), ((System.Byte)(188)), ((System.Byte)(124)));
     //
     // tChart1.Walls.Left.Gradient
     //
     this.tChart1.Walls.Left.Gradient.EndColor   = System.Drawing.Color.FromArgb(((System.Byte)(36)), ((System.Byte)(209)), ((System.Byte)(252)));
     this.tChart1.Walls.Left.Gradient.StartColor = System.Drawing.Color.FromArgb(((System.Byte)(13)), ((System.Byte)(188)), ((System.Byte)(124)));
     this.tChart1.Walls.Left.Size = 8;
     //
     // tChart1.Walls.Right
     //
     this.tChart1.Walls.Right.ApplyDark = false;
     //
     // tChart1.Walls.Right.Brush
     //
     this.tChart1.Walls.Right.Brush.Color = System.Drawing.Color.White;
     this.tChart1.Walls.Right.Size        = 8;
     //
     // area1
     //
     //
     // area1.AreaBrush
     //
     this.area1.AreaBrush.Color = System.Drawing.Color.FromArgb(((System.Byte)(254)), ((System.Byte)(255)), ((System.Byte)(0)), ((System.Byte)(0)));
     //
     // area1.Brush
     //
     this.area1.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(0)), ((System.Byte)(0)));
     //
     // area1.Marks
     //
     //
     // area1.Marks.Arrow
     //
     this.area1.Marks.Arrow.Color = System.Drawing.Color.Black;
     //
     // area1.Marks.Brush
     //
     //
     // area1.Marks.Gradient
     //
     this.area1.Marks.Brush.Gradient.StartColor = System.Drawing.Color.Silver;
     //
     // area1.Marks.Font
     //
     this.area1.Marks.Font.Name = "Times New Roman";
     this.area1.Marks.Font.Size = 10;
     //
     // area1.Marks.Gradient
     //
     this.area1.Marks.Gradient.StartColor = System.Drawing.Color.Silver;
     //
     // area1.Marks.Symbol
     //
     //
     // area1.Marks.Symbol.Shadow
     //
     this.area1.Marks.Symbol.Shadow.Height  = 1;
     this.area1.Marks.Symbol.Shadow.Visible = true;
     this.area1.Marks.Symbol.Shadow.Width   = 1;
     this.area1.Marks.Transparent           = true;
     //
     // area1.Pointer
     //
     this.area1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Rectangle;
     this.area1.Title         = "area1";
     //
     // area1.XValues
     //
     this.area1.XValues.DataMember = "X";
     this.area1.XValues.Order      = Steema.TeeChart.Styles.ValueListOrder.Ascending;
     //
     // area1.YValues
     //
     this.area1.YValues.DataMember = "Y";
     //
     // bar1
     //
     //
     // bar1.Brush
     //
     this.bar1.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(255)), ((System.Byte)(0)));
     //
     // bar1.Marks
     //
     //
     // bar1.Marks.Arrow
     //
     this.bar1.Marks.Arrow.Color = System.Drawing.Color.Black;
     //
     // bar1.Marks.Brush
     //
     //
     // bar1.Marks.Gradient
     //
     this.bar1.Marks.Brush.Gradient.StartColor = System.Drawing.Color.Silver;
     //
     // bar1.Marks.Font
     //
     this.bar1.Marks.Font.Name = "Times New Roman";
     this.bar1.Marks.Font.Size = 10;
     //
     // bar1.Marks.Gradient
     //
     this.bar1.Marks.Gradient.StartColor = System.Drawing.Color.Silver;
     //
     // bar1.Marks.Symbol
     //
     //
     // bar1.Marks.Symbol.Shadow
     //
     this.bar1.Marks.Symbol.Shadow.Height  = 1;
     this.bar1.Marks.Symbol.Shadow.Visible = true;
     this.bar1.Marks.Symbol.Shadow.Width   = 1;
     this.bar1.Marks.Transparent           = true;
     this.bar1.Marks.Visible = false;
     this.bar1.Title         = "bar1";
     //
     // bar1.XValues
     //
     this.bar1.XValues.DataMember = "X";
     this.bar1.XValues.Order      = Steema.TeeChart.Styles.ValueListOrder.Ascending;
     //
     // bar1.YValues
     //
     this.bar1.YValues.DataMember = "Bar";
     //
     // line1
     //
     //
     // line1.Brush
     //
     this.line1.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(0)));
     //
     // line1.Marks
     //
     //
     // line1.Marks.Arrow
     //
     this.line1.Marks.Arrow.Color = System.Drawing.Color.Black;
     //
     // line1.Marks.Brush
     //
     //
     // line1.Marks.Gradient
     //
     this.line1.Marks.Brush.Gradient.StartColor = System.Drawing.Color.Silver;
     //
     // line1.Marks.Font
     //
     this.line1.Marks.Font.Name = "Times New Roman";
     this.line1.Marks.Font.Size = 10;
     //
     // line1.Marks.Gradient
     //
     this.line1.Marks.Gradient.StartColor = System.Drawing.Color.Silver;
     //
     // line1.Marks.Symbol
     //
     //
     // line1.Marks.Symbol.Shadow
     //
     this.line1.Marks.Symbol.Shadow.Height  = 1;
     this.line1.Marks.Symbol.Shadow.Visible = true;
     this.line1.Marks.Symbol.Shadow.Width   = 1;
     this.line1.Marks.Transparent           = true;
     //
     // line1.Pointer
     //
     this.line1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Rectangle;
     this.line1.Title         = "line1";
     //
     // line1.XValues
     //
     this.line1.XValues.DataMember = "X";
     this.line1.XValues.Order      = Steema.TeeChart.Styles.ValueListOrder.Ascending;
     //
     // line1.YValues
     //
     this.line1.YValues.DataMember = "Y";
     //
     // points1
     //
     //
     // points1.Marks
     //
     //
     // points1.Marks.Arrow
     //
     this.points1.Marks.Arrow.Color = System.Drawing.Color.Black;
     //
     // points1.Marks.Brush
     //
     //
     // points1.Marks.Gradient
     //
     this.points1.Marks.Brush.Gradient.StartColor = System.Drawing.Color.Silver;
     //
     // points1.Marks.Font
     //
     this.points1.Marks.Font.Name = "Times New Roman";
     this.points1.Marks.Font.Size = 10;
     //
     // points1.Marks.Gradient
     //
     this.points1.Marks.Gradient.StartColor = System.Drawing.Color.Silver;
     //
     // points1.Marks.Symbol
     //
     //
     // points1.Marks.Symbol.Shadow
     //
     this.points1.Marks.Symbol.Shadow.Height  = 1;
     this.points1.Marks.Symbol.Shadow.Visible = true;
     this.points1.Marks.Symbol.Shadow.Width   = 1;
     this.points1.Marks.Transparent           = true;
     //
     // points1.Pointer
     //
     //
     // points1.Pointer.Brush
     //
     this.points1.Pointer.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(255)));
     this.points1.Pointer.Style       = Steema.TeeChart.Styles.PointerStyles.Rectangle;
     this.points1.Title = "points1";
     //
     // points1.XValues
     //
     this.points1.XValues.DataMember = "X";
     this.points1.XValues.Order      = Steema.TeeChart.Styles.ValueListOrder.Ascending;
     //
     // points1.YValues
     //
     this.points1.YValues.DataMember = "Y";
     //
     // groupBox1
     //
     this.groupBox1.Controls.Add(this.radioButton2);
     this.groupBox1.Controls.Add(this.radioButton1);
     this.groupBox1.Location = new System.Drawing.Point(16, 0);
     this.groupBox1.Name     = "groupBox1";
     this.groupBox1.Size     = new System.Drawing.Size(144, 40);
     this.groupBox1.TabIndex = 0;
     this.groupBox1.TabStop  = false;
     this.groupBox1.Text     = "Check Style";
     //
     // radioButton2
     //
     this.radioButton2.Location = new System.Drawing.Point(80, 18);
     this.radioButton2.Name     = "radioButton2";
     this.radioButton2.Size     = new System.Drawing.Size(56, 14);
     this.radioButton2.TabIndex = 1;
     this.radioButton2.Text     = "Radio";
     this.radioButton2.Click   += new System.EventHandler(this.RadioButtons_Click);
     //
     // radioButton1
     //
     this.radioButton1.Checked  = true;
     this.radioButton1.Location = new System.Drawing.Point(11, 18);
     this.radioButton1.Name     = "radioButton1";
     this.radioButton1.Size     = new System.Drawing.Size(56, 14);
     this.radioButton1.TabIndex = 0;
     this.radioButton1.TabStop  = true;
     this.radioButton1.Text     = "Check";
     this.radioButton1.Click   += new System.EventHandler(this.RadioButtons_Click);
     //
     // ChartListBoxRadio
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(426, 258);
     this.Name = "ChartListBoxRadio";
     this.panel1.ResumeLayout(false);
     this.panel2.ResumeLayout(false);
     this.groupBox1.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Ejemplo n.º 9
0
        private static void CreateGraph(StreamWriter OutputFile, XmlNode N, int NextLevel)
        {
            string InstanceName = XmlHelper.Name(N.OwnerDocument.DocumentElement);
            string GraphName;

            if (N.Name == "XYPairs")
            {
                GraphName = XmlHelper.Name(N.ParentNode.ParentNode) + XmlHelper.Name(N.ParentNode) + "Graph";
            }
            else
            {
                GraphName = XmlHelper.Name(N.ParentNode) + XmlHelper.Name(N) + "Graph";
            }

            Directory.CreateDirectory(InstanceName + "Graphs");
            string GifFileName = InstanceName + "Graphs\\" + GraphName + ".gif";

            // Setup cleanish graph.
            TChart Graph = new TChart();

            Graph.Aspect.View3D                  = false;
            Graph.Legend.Visible                 = false;
            Graph.Axes.Left.AutomaticMinimum     = false;
            Graph.Axes.Left.Minimum              = 0.0000000005;
            Graph.Axes.Left.Grid.Visible         = false;
            Graph.Axes.Left.Labels.ValueFormat   = "###0.###";
            Graph.Axes.Left.MinorTicks.Visible   = false;
            Graph.Axes.Left.MaximumOffset        = 1;
            Graph.Axes.Bottom.AutomaticMinimum   = false;
            Graph.Axes.Bottom.Minimum            = 0;
            Graph.Axes.Bottom.Grid.Visible       = false;
            Graph.Axes.Bottom.Labels.ValueFormat = "###0.###";
            Graph.Axes.Bottom.MinorTicks.Visible = false;
            Graph.Axes.Bottom.MaximumOffset      = 4;
            Graph.Walls.Visible                  = false;
            Graph.Header.Text            = GraphName;
            Graph.Panel.Bevel.Outer      = Steema.TeeChart.Drawing.BevelStyles.None;
            Graph.Panel.Brush.Color      = Color.White;
            Graph.Panel.ImageBevel.Width = 1;
            Graph.Panel.Shadow.Visible   = false;
            Graph.Panel.Gradient.Visible = false;

            // Create a line series.
            Steema.TeeChart.Styles.Line LineSeries = new Steema.TeeChart.Styles.Line();
            Graph.Series.Add(LineSeries);

            // work out x and y variable names.
            string XName = XmlHelper.Value(N.ParentNode, "XProperty");

            if (N.ParentNode.Name == "TemperatureFunction")
            {
                XName = "Temperature (oC)";
            }

            string YName;

            if (N.Name == "XYPairs")
            {
                YName = XmlHelper.Name(N.ParentNode);
            }
            else
            {
                YName = XmlHelper.Name(N);
            }
            if (YName == "Function")
            {
                YName = XmlHelper.Name(N.ParentNode.ParentNode);
            }

            Graph.Axes.Left.Title.Text   = YName;
            Graph.Axes.Bottom.Title.Text = XName;

            // Set up to write a table.
            OutputFile.WriteLine("<table border=\"0\">");
            //   OutputFile.WriteLine("<td></td><td></td>");
            //   OutputFile.WriteLine("<tr>");

            // output xy table as a nested table.
            OutputFile.WriteLine("<td>");
            OutputFile.WriteLine("<table width=\"250\">");
            OutputFile.WriteLine("<td><b>" + XName + "</b></td><td><b>" + YName + "</b></td>");
            List <string> XYs = XmlHelper.Values(N, "xy");

            foreach (string XY in XYs)
            {
                string[] XYValues = XY.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                if (XYValues.Length == 2)
                {
                    LineSeries.Add(Convert.ToDouble(XYValues[0]), Convert.ToDouble(XYValues[1]));
                }
                if (Convert.ToDouble(XYValues[1]) < 0.05 && Convert.ToDouble(XYValues[1]) > 0)
                {
                    Graph.Axes.Left.Labels.ValueFormat = "#.#######";
                }

                OutputFile.WriteLine("<tr><td>" + XYValues[0] + "</td><td>" + XYValues[1] + "</td></tr>");
            }
            OutputFile.WriteLine("</table>");
            OutputFile.WriteLine("</td>");

            // output chart as a column to the outer table.
            OutputFile.WriteLine("<td>");
            OutputFile.WriteLine("<img src=\"" + GifFileName + "\">");
            OutputFile.WriteLine("</td>");
            OutputFile.WriteLine("</tr>");
            OutputFile.WriteLine("</table>");

            // Export graph to bitmap file.
            Rectangle         Bounds = new Rectangle(0, 0, 300, 200);
            Stream            stream = new FileStream(GifFileName, FileMode.Create);
            ImageExportFormat image  = Graph.Chart.Export.Image.GIF;

            image.Width  = Bounds.Width;
            image.Height = Bounds.Height;
            image.Save(stream);
            stream.Close();
        }