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;
            //}
        }
Esempio n. 2
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);
        }