public TrendlineProFunctionChart(ChartView BaseChart)
        {
            area          = new Area();
            line          = new Line();
            trendFunction = new TrendFunction();
            var           = new Variables.Variables();

            BaseChart.Chart.Title.Text                   = "Trendline";
            BaseChart.Chart.Axes.Left.Automatic          = true;
            BaseChart.Chart.Axes.Left.Ticks.Transparency = 100;
            BaseChart.Chart.Axes.Bottom.Automatic        = true;
            BaseChart.Chart.Axes.Left.Increment          = 40;

            BaseChart.Chart.Series.Add(area);

            area.FillSampleValues(15);
            area.Color           = var.GetPaletteBasic[0];
            area.AreaLines.Color = var.GetPaletteBasic[0];
            area.LinePen.Color   = var.GetPaletteBasic[0].AddLuminosity(-0.2);
            area.Title           = "Data Source";

            BaseChart.Chart.Series.Add(line);

            line.DataSource    = area;
            line.Function      = trendFunction;
            line.Title         = "Trendline";
            line.LinePen.Width = 3;
            line.Color         = var.GetPaletteBasic[1];

            trendFunction.TrendStyle = TrendStyles.Normal;
        }
        public CorrelationProFunctionChart(ChartView BaseChart)
        {
            points              = new Points();
            correlation         = new Line();
            trend               = new Line();
            correlationFunction = new CorrelationFunction();
            trendFunction       = new TrendFunction();
            var = new Variables.Variables();

            BaseChart.Chart.Title.Text          = "Correlation";
            BaseChart.Chart.Axes.Left.Increment = 50;

            FillSampleValues(points, 20);
            points.Color              = var.GetPaletteBasic[0];
            points.Title              = "Data Source";
            points.Pointer.Style      = PointerStyles.Diamond;
            points.Pointer.HorizSize += 3;
            points.Pointer.VertSize  += 3;
            points.Pointer.Pen.Color  = var.GetPaletteBasic[0].AddLuminosity(-0.25);

            correlation.LinePen.Width = 3;
            correlation.Color         = var.GetPaletteBasic[1];
            //correlation.LinePen.Style = DashStyle.Dot;
            correlation.Function   = correlationFunction;
            correlation.DataSource = points;
            correlation.Title      = "Correlation";

            correlationFunction.TrendStyle = TrendStyles.Logarithmic;

            trend.Title         = "Trend";
            trend.Function      = trendFunction;
            trend.DataSource    = points;
            trend.LinePen.Width = 3;
            trend.Color         = var.GetPaletteBasic[2];

            trendFunction.TrendStyle = TrendStyles.Normal;
            trendFunction.Period     = 10;

            BaseChart.Chart.Axes.Left.Automatic          = true;
            BaseChart.Chart.Axes.Bottom.Automatic        = true;
            BaseChart.Chart.Axes.Left.Ticks.Transparency = 100;

            BaseChart.Chart.Series.Add(points);
            BaseChart.Chart.Series.Add(correlation);
            BaseChart.Chart.Series.Add(trend);
        }
Exemple #3
0
        public ExponentialTrendProFunctionChart(ChartView BaseChart)
        {
            flineSource      = new FastLine();
            flineExpTrend    = new FastLine();
            expTrendFunction = new ExpTrendFunction();
            flineTrend       = new FastLine();
            trendFunction    = new TrendFunction();
            var = new Variables.Variables();

            BaseChart.Chart.Title.Text                   = "Exponential Trend";
            BaseChart.Chart.Axes.Left.Automatic          = true;
            BaseChart.Chart.Axes.Left.Ticks.Transparency = 100;
            BaseChart.Chart.Axes.Bottom.Automatic        = true;
            BaseChart.Chart.Axes.Left.Increment          = 50;

            FillSampleValues(flineSource, 50, 800);
            flineSource.Title         = "Data Source";
            flineSource.LinePen.Width = 3;
            flineSource.Color         = var.GetPaletteBasic[0];

            flineExpTrend.DataSource    = flineSource;
            flineExpTrend.Function      = expTrendFunction;
            flineExpTrend.LinePen.Width = 3;
            flineExpTrend.Color         = var.GetPaletteBasic[1];
            flineExpTrend.Title         = "Exp. Trend";

            expTrendFunction.TrendStyle = TrendStyles.Exponential;
            trendFunction.TrendStyle    = TrendStyles.Normal;

            flineTrend.DataSource    = flineSource;
            flineTrend.Function      = trendFunction;
            flineTrend.LinePen.Width = 3;
            flineTrend.Color         = var.GetPaletteBasic[2];
            flineTrend.Title         = "Trend";

            BaseChart.Chart.Series.Add(flineSource);
            BaseChart.Chart.Series.Add(flineTrend);
            BaseChart.Chart.Series.Add(flineExpTrend);

            ((((BaseChart.Parent as StackLayout).Parent as Grid).Parent as ContentPage).Parent as TabbedPage).Title = "Exp. Trend";
        }