private void InitializeChart()
        {
            tChart1.Header.Text       = "Scroll Pager Tool";
            tChart1.Series.Add(series = new FastLine());
            series.FillSampleValues(1000);
            tChart1.Tools.Add(tool     = new ScrollPager());
            tChart1.Tools.Add(point    = new NearestPoint());
            tChart1.Tools.Add(annotate = new Annotation());

            point.Brush.Color = tool.PointerHighlightColor;
            point.DrawLine    = false;
            point.Size        = 6;
            point.Direction   = NearestPointDirection.Horizontal;
            point.Series      = series;
            point.Change     += new EventHandler(point_Change);

            annotate.Position             = AnnotationPositions.RightTop;
            annotate.Text                 = "YValue:";
            annotate.Shape.Shadow.Visible = false;
            annotate.Shape.Font.Color     = tChart1.Header.Font.Color;
            annotate.Shape.Color          = tool.PointerHighlightColor;
            annotate.Shape.Pen.Visible    = false;
            annotate.TextAlign            = StringAlignment.Center;

            Theme.ApplyChartTheme(typeof(FlatTheme), tool.SubChartTChart.Chart);
        }
        private void InitializeChart()
        {
            tChart1.Frame = this.View.Frame;

            tChart1.Header.Text       = "Scroll Pager Tool";
            tChart1.Panning.Active    = true;
            tChart1.Series.Add(series = new FastLine());
            series.FillSampleValues(1000);

            tChart1.Tools.Add(tool = new ScrollPager());

            for (int i = 0; i < tChart1.Series.Count; i++)
            {
                if (tChart1.Series[i].Count > 0)
                {
                    tool.Series = tChart1.Series[i];
                }
            }

            tool.ColorBandTool.StartLine.AllowDrag = true;
            tool.ColorBandTool.EndLine.AllowDrag   = true;
            tool.ColorBandTool.StartLine.Active    = true;
            tool.ColorBandTool.EndLine.Active      = true;


            tChart1.Tools.Add(colorlinetool = new ColorLine());
            colorlinetool.Value             = 100;
            colorlinetool.AllowDrag         = true;
            colorlinetool.Pen.Color         = Color.Blue;

            tChart1.ClickBackground += TChart1_ClickBackground;

            tChart1.Tools.Add(point    = new NearestPoint());
            tChart1.Tools.Add(annotate = new Annotation());

            point.Brush.Color = tool.PointerHighlightColor;
            point.DrawLine    = false;
            point.Size        = 6;
            point.Direction   = NearestPointDirection.Horizontal;
            point.Series      = series;
            point.Change     += Point_Change;

            annotate.Position             = AnnotationPositions.RightTop;
            annotate.Text                 = "YValue:";
            annotate.Shape.Shadow.Visible = false;
            annotate.Shape.Font.Color     = Color.Red;
            annotate.Shape.Color          = tool.PointerHighlightColor;
            annotate.Shape.Font.Size      = 15;
            annotate.Shape.Pen.Visible    = false;
            annotate.Shape.Transparent    = true;
            annotate.TextAlign            = CoreText.CTTextAlignment.Center;

            tChart1.Panel.Gradient.Visible = false;

            this.View.AddSubview(tChart1);
        }
Ejemplo n.º 3
0
        private void InitializeChart()
        {
            tChart1.Chart.Header.Text       = "Scroll Pager Tool";
            tChart1.Chart.Panning.Active    = true;
            tChart1.Chart.Series.Add(series = new FastLine());
            series.FillSampleValues(1000);

            tChart1.Chart.Tools.Add(tool = new ScrollPager());

            for (int i = 0; i < tChart1.Chart.Series.Count; i++)
            {
                if (tChart1.Chart.Series[i].Count > 0)
                {
                    tool.Series = tChart1.Chart.Series[i];
                }
            }

            tool.ColorBandTool.StartLine.AllowDrag = true;
            tool.ColorBandTool.EndLine.AllowDrag   = true;
            tool.ColorBandTool.StartLine.Active    = true;
            tool.ColorBandTool.EndLine.Active      = true;


            tChart1.Chart.Tools.Add(colorlinetool = new ColorLine());
            colorlinetool.Value     = 100;
            colorlinetool.AllowDrag = true;
            colorlinetool.Pen.Color = Color.Blue;

            tChart1.Chart.ClickBackground += TChart1_ClickBackground;

            tChart1.Chart.Tools.Add(point    = new NearestPoint());
            tChart1.Chart.Tools.Add(annotate = new Annotation());

            point.Brush.Color = tool.PointerHighlightColor;
            point.DrawLine    = false;
            point.Size        = 6;
            point.Direction   = NearestPointDirection.Horizontal;
            point.Series      = series;
            point.Change     += new EventHandler(point_Change);

            annotate.Position             = AnnotationPositions.RightTop;
            annotate.Text                 = "YValue:";
            annotate.Shape.Shadow.Visible = false;
            annotate.Shape.Font.Color     = tChart1.Chart.Header.Font.Color;
            annotate.Shape.Color          = tool.PointerHighlightColor;
            annotate.Shape.Pen.Visible    = false;
            annotate.Shape.Font.Color     = Color.White;
            annotate.TextAlign            = TextAlignment.Center;

            //Theme.ApplyChartTheme(typeof(FlatTheme), tool.SubChartTChart.Chart);
        }
        public FindCoeffProFunctionChart(ChartView BaseChart)
        {
            fastLineSource = new FastLine();
            fastLineCoe1   = new FastLine();
            fastLineCoe2   = new FastLine();
#if !TEE_STD
            polyFitting  = new PolyFitting();
            polyFitting2 = new PolyFitting();

            var = new Variables.Variables();

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

            fastLineSource.FillSampleValues(40);
            fastLineSource.LinePen.Width   = 3;
            fastLineSource.Color           = var.GetPaletteBasic[0];
            fastLineSource.Title           = "Data Source";
            fastLineSource.Marks.DrawEvery = 4;

            fastLineCoe1.DataSource      = fastLineSource;
            fastLineCoe1.Function        = polyFitting;
            fastLineCoe1.LinePen.Width   = 3;
            fastLineCoe1.Color           = var.GetPaletteBasic[1];
            fastLineCoe1.Title           = "Curve 1";
            fastLineCoe1.Marks.DrawEvery = 4;

            fastLineCoe2.DataSource      = fastLineSource;
            fastLineCoe2.Function        = polyFitting2;
            fastLineCoe2.LinePen.Width   = 3;
            fastLineCoe2.Color           = var.GetPaletteBasic[2];
            fastLineCoe2.Title           = "Curve 2";
            fastLineCoe2.Marks.DrawEvery = 4;

            polyFitting.PolyDegree  = 5;
            polyFitting2.PolyDegree = 14;

            BaseChart.Chart.Series.Add(fastLineSource);
            BaseChart.Chart.Series.Add(fastLineCoe1);
            BaseChart.Chart.Series.Add(fastLineCoe2);
#endif
        }
Ejemplo n.º 5
0
        private void ChartToCreate(String item)
        {
            List <String[]> originalData = ChartData();

            String[] dataPicker = new String[originalData.Count];

            for (int i = 0; i < originalData.Count; i++)
            {
                dataPicker[i] = originalData[i][1];
            }
            _customChart.ChartView.Chart.Series.RemoveAllSeries();

            var imageButton = ((((this.Children[0] as ContentPage).Content as ScrollView).Content as StackLayout).Children[1] as Grid).Children[2] as Button;

            switch (item)
            {
            case "AREA":
                Area area = new Area();
                area.FillSampleValues(3);
                _customChart.ChartView.Chart.Series.Add(area);
                _customChart.ImageSource = dataPicker[0];
                imageButton.ImageSource  = dataPicker[0];

                break;

                    #if !TEE_STD
            case "ARROW":
                Arrow arrow = new Arrow();
                arrow.FillSampleValues(10);
                _customChart.ChartView.Chart.Series.Add(arrow);
                _customChart.ImageSource = dataPicker[1];
                imageButton.ImageSource  = dataPicker[1];
                break;
#endif

            case "BAR":
                Bar bar = new Bar();
                bar.FillSampleValues(4);
                _customChart.ChartView.Chart.Series.Add(bar);
                _customChart.ImageSource = dataPicker[2];
                imageButton.ImageSource  = dataPicker[2];
                break;

                    #if !TEE_STD
            case "BARJOIN":
                BarJoin barjoin = new BarJoin();
                barjoin.FillSampleValues(5);
                _customChart.ChartView.Chart.Series.Add(barjoin);
                _customChart.ImageSource = dataPicker[3];
                imageButton.ImageSource  = dataPicker[3];
                break;

            case "BEZIER":
                Bezier bezier = new Bezier();
                bezier.FillSampleValues(5);
                _customChart.ChartView.Chart.Series.Add(bezier);
                _customChart.ImageSource = dataPicker[4];
                imageButton.ImageSource  = dataPicker[4];
                break;

            case "BOX":
                Box box = new Box();
                box.FillSampleValues(3);
                _customChart.ChartView.Chart.Series.Add(box);
                _customChart.ImageSource = dataPicker[5];
                imageButton.ImageSource  = dataPicker[5];
                break;
#endif
            case "BUBBLES":
                Bubble bubble = new Bubble();
                bubble.FillSampleValues(7);
                _customChart.ChartView.Chart.Series.Add(bubble);
                _customChart.ImageSource = dataPicker[6];
                imageButton.ImageSource  = dataPicker[6];
                break;

                    #if !TEE_STD
            case "CANDLE":
                Candle candle = new Candle();
                candle.FillSampleValues(5);
                _customChart.ChartView.Chart.Series.Add(candle);
                _customChart.ImageSource = dataPicker[7];
                imageButton.ImageSource  = dataPicker[7];
                break;

            case "CONTOUR":
                Contour countour = new Contour();
                countour.FillSampleValues(1);
                _customChart.ChartView.Chart.Series.Add(countour);
                _customChart.ImageSource = dataPicker[8];
                imageButton.ImageSource  = dataPicker[8];
                break;

            case "DARVAS":
                Darvas darvas = new Darvas();
                darvas.FillSampleValues(3);
                _customChart.ChartView.Chart.Series.Add(darvas);
                _customChart.ImageSource = dataPicker[9];
                imageButton.ImageSource  = dataPicker[9];
                break;
#endif
            case "DONUT":
                Donut donut = new Donut();
                donut.FillSampleValues(1);
                _customChart.ChartView.Chart.Series.Add(donut);
                _customChart.ImageSource = dataPicker[10];
                imageButton.ImageSource  = dataPicker[10];
                break;

                    #if !TEE_STD
            case "ERROR":
                Error error = new Error();
                error.FillSampleValues(5);
                _customChart.ChartView.Chart.Series.Add(error);
                _customChart.ImageSource = dataPicker[11];
                imageButton.ImageSource  = dataPicker[11];
                break;

            case "ERRORBAR":
                ErrorBar errorbar = new ErrorBar();
                errorbar.FillSampleValues(5);
                _customChart.ChartView.Chart.Series.Add(errorbar);
                _customChart.ImageSource = dataPicker[12];
                imageButton.ImageSource  = dataPicker[12];
                break;

            case "ERRORPOINT":
                ErrorPoint errorPoint = new ErrorPoint();
                errorPoint.FillSampleValues(7);
                _customChart.ChartView.Chart.Series.Add(errorPoint);
                _customChart.ImageSource = dataPicker[13];
                imageButton.ImageSource  = dataPicker[13];
                break;
#endif
            case "FASTLINE":
                FastLine fastLine = new FastLine();
                fastLine.FillSampleValues(2);
                _customChart.ChartView.Chart.Series.Add(fastLine);
                _customChart.ImageSource = dataPicker[14];
                imageButton.ImageSource  = dataPicker[14];
                break;

                    #if !TEE_STD
            case "HIGHLOW":
                HighLow highLow = new HighLow();
                highLow.FillSampleValues(4);
                _customChart.ChartView.Chart.Series.Add(highLow);
                _customChart.ImageSource = dataPicker[15];
                imageButton.ImageSource  = dataPicker[15];
                break;

            case "HISTOGRAM":
                Histogram histogram = new Histogram();
                histogram.FillSampleValues(6);
                _customChart.ChartView.Chart.Series.Add(histogram);
                _customChart.ImageSource = dataPicker[16];
                imageButton.ImageSource  = dataPicker[16];
                break;
#endif
            case "HORIZAREA":
                HorizArea horizArea = new HorizArea();
                horizArea.FillSampleValues(6);
                _customChart.ChartView.Chart.Series.Add(horizArea);
                _customChart.ImageSource = dataPicker[17];
                imageButton.ImageSource  = dataPicker[17];
                break;

            case "HORIZBAR":
                HorizBar horizBar = new HorizBar();
                horizBar.FillSampleValues(6);
                _customChart.ChartView.Chart.Series.Add(horizBar);
                _customChart.ImageSource = dataPicker[18];
                imageButton.ImageSource  = dataPicker[18];
                break;

            case "HORIZLINE":
                HorizLine horizLine = new HorizLine();
                horizLine.FillSampleValues(6);
                _customChart.ChartView.Chart.Series.Add(horizLine);
                _customChart.ImageSource = dataPicker[19];
                imageButton.ImageSource  = dataPicker[19];
                break;

                    #if !TEE_STD
            case "ISOSURFACE":
                IsoSurface isoSurface = new IsoSurface();
                isoSurface.FillSampleValues(10);
                _customChart.ChartView.Chart.Series.Add(isoSurface);
                _customChart.ImageSource = dataPicker[20];
                imageButton.ImageSource  = dataPicker[20];
                break;
#endif
            case "LINE":
                Line line = new Line();
                line.FillSampleValues(5);
                _customChart.ChartView.Chart.Series.Add(line);
                _customChart.ImageSource = dataPicker[21];
                imageButton.ImageSource  = dataPicker[21];
                break;

#if !TEE_STD
            case "LINEPOINT":
                LinePoint linePoint = new LinePoint();
                linePoint.FillSampleValues(6);
                _customChart.ChartView.Chart.Series.Add(linePoint);
                _customChart.ImageSource = dataPicker[22];
                imageButton.ImageSource  = dataPicker[22];
                break;
#endif
            case "PIE":
                Pie pie = new Pie();
                pie.FillSampleValues(4);
                _customChart.ChartView.Chart.Series.Add(pie);
                _customChart.ImageSource = dataPicker[23];
                imageButton.ImageSource  = dataPicker[23];
                break;

#if !TEE_STD
            case "SURFACE":
                Surface surface = new Surface();
                surface.FillSampleValues(10);
                //surface.
                _customChart.ChartView.Chart.Series.Add(surface);
                _customChart.ImageSource = dataPicker[24];
                imageButton.ImageSource  = dataPicker[24];
                break;

            case "TOWER":
                Tower tower = new Tower();
                tower.FillSampleValues(8);
                _customChart.ChartView.Chart.Series.Add(tower);
                _customChart.ImageSource = dataPicker[25];
                imageButton.ImageSource  = dataPicker[25];
                break;

            case "VOLUME":
                Volume volume = new Volume();
                volume.FillSampleValues(9);
                _customChart.ChartView.Chart.Series.Add(volume);
                _customChart.ImageSource = dataPicker[26];
                imageButton.ImageSource  = dataPicker[26];
                break;
#endif
            }

            _customChart.ChartView.Chart.Axes.Left.Automatic   = true;
            _customChart.ChartView.Chart.Axes.Bottom.Automatic = true;
        }