Пример #1
0
        public ErrorBarChart(ChartView BaseChart)
        {
            errorBar = new ErrorBar();
            var      = new Variables.Variables();
            tool_dataPointSelection = new DataPointSelection(BaseChart);
            this.BaseChart          = BaseChart;

            BaseChart.Chart.Axes.Left.AxisPen.Visible = true;
            BaseChart.Chart.Axes.Left.Visible         = true;
            BaseChart.Chart.Axes.Bottom.Visible       = true;

            for (int i = 0; i < var.GetValorsErrorBar.Length / 3; i++)
            {
                errorBar.Add(var.GetValorsErrorBar[i, 0], var.GetValorsErrorBar[i, 1], var.GetValorsErrorBar[i, 2], var.GetPaletteBasic[i]);
            }

            errorBar.ErrorPen.Width = 2;
            errorBar.ErrorPen.Color = Color.Black;

            BaseChart.Chart.Series.Add(errorBar);

            BaseChart.Chart.Header.Text = "Error Bar";

            BaseChart.Chart.Axes.Left.AxisPen.Visible    = true;
            BaseChart.Chart.Axes.Left.Visible            = true;
            BaseChart.Chart.Axes.Left.Grid.Visible       = true;
            BaseChart.Chart.Axes.Left.Ticks.Transparency = 100;

            BaseChart.Chart.Axes.Left.SetMinMax(BaseChart.Chart.Axes.Left.MinYValue, BaseChart.Chart.Axes.Left.MaxYValue);
            BaseChart.Chart.Axes.Bottom.SetMinMax(0, BaseChart.Chart.Axes.Bottom.MaxXValue);
            BaseChart.Chart.Axes.Left.Increment = 50;

            BaseChart.Chart.Legend.Visible = false;

            errorBar.GetBarStyle        += ErrorBar_GetBarStyle;
            BaseChart.Chart.ClickSeries += tool_dataPointSelection.ErrorBarSeries_Click;
            errorBar.GetSeriesMark      += tool_dataPointSelection.SerieErrorBar_GetSeriesMark;

            errorBar.Marks.Visible        = false;
            errorBar.MarksOnBar           = true;
            errorBar.MarksLocation        = MarksLocation.End;
            errorBar.Marks.TailStyle      = MarksTail.None;
            errorBar.Marks.Font.Size      = 12;
            errorBar.Marks.Frame.Color    = Color.Transparent;
            errorBar.Marks.Pen.Color      = Color.Black;
            errorBar.Marks.Color          = Color.White;
            errorBar.Marks.Height        += 10;
            errorBar.Marks.Shadow.Visible = false;
        }
Пример #2
0
        public HistogramChart(ChartView BaseChart)
        {
            histogram = new Histogram();
            var       = new Variables.Variables();
            tool_dataPointSelection = new DataPointSelection(BaseChart);
            this.BaseChart          = BaseChart;

            BaseChart.Chart.Title.Text = "Histogram";

            for (int i = 0; i < var.GetValorsHistogram.Length / 2; i++)
            {
                histogram.Add(var.GetValorsHistogram[i, 0], var.GetValorsHistogram[i, 1], var.GetPaletteBasic[0]);
            }

            BaseChart.Chart.Series.Add(histogram);
            BaseChart.Chart.Axes.Left.Visible   = true;
            BaseChart.Chart.Axes.Bottom.Visible = true;
            BaseChart.Chart.Axes.Left.SetMinMax(0, BaseChart.Chart.Axes.Left.MaxYValue + 5);
            BaseChart.Chart.Axes.Bottom.SetMinMax(BaseChart.Chart.Axes.Bottom.MinXValue, BaseChart.Chart.Axes.Bottom.MaxXValue);

            BaseChart.Chart.Axes.Left.Visible            = true;
            BaseChart.Chart.Axes.Left.AxisPen.Visible    = true;
            BaseChart.Chart.Axes.Left.Ticks.Transparency = 100;
            BaseChart.Chart.Axes.Left.Increment          = 5;
            BaseChart.Chart.Axes.Left.Grid.Visible       = true;
            BaseChart.Chart.Legend.Visible = false;

            Themes.AplicarMarksTheme1(BaseChart);

            histogram.Marks.TailParams.Align = TailAlignment.BottomCenter;
            histogram.Marks.BackColor        = var.GetPaletteBasic[0].AddLuminosity(-0.2);
            histogram.Marks.Width           -= 15;
            histogram.Color          = var.GetPaletteBasic[0];
            histogram.LinePen.Color  = var.GetPaletteBasic[0].AddLuminosity(-0.3);
            histogram.LinesPen.Color = var.GetPaletteBasic[0].AddLuminosity(-0.3);

            BaseChart.Chart.ClickSeries += tool_dataPointSelection.HistoSeries_Click;
            histogram.GetSeriesMark     += tool_dataPointSelection.SerieHistogram_GetSeriesMark;
        }
        public Semi_DonutChartFeatures(ChartView BaseChart)
        {
            donut1               = new Donut();
            var                  = new Variables.Variables();
            this.BaseChart       = BaseChart;
            tool_dataPointSelect = new Tools.DataPointSelection(BaseChart);

            BaseChart.Chart.Header.Text = "How old are the workers";
            BaseChart.Chart.Series.Add(donut1);
            BaseChart.Chart.Legend.Visible = true;

            donut1.SeriesColor         = var.GetPaletteBasic[0];
            donut1.Chart.Zoom.Allow    = false;
            donut1.Chart.Panning.Allow = ScrollModes.None;

            donut1.AutoCircleResize = true;
            donut1.RecalcOptions    = RecalcOptions.OnModify;
            donut1.DefaultNullValue = 0;
            donut1.Circled          = true;
            donut1.AutoPenColor     = false;
            donut1.DarkPen          = false;
            donut1.Pen.Width        = 3;
            donut1.Pen.Style        = DashStyle.Solid;
            donut1.Pen.Visible      = true;
            donut1.Pen.Color        = Color.White;
            donut1.AngleSize        = 180;
            donut1.VertAxis         = VerticalAxis.Both;
            donut1.HorizAxis        = HorizontalAxis.Both;

            donut1.CustomXRadius = BaseChart.Chart.Axes.Bottom.MaxXValue;
            for (int i = 0; i < var.GetValorDonut1.Length; i++)
            {
                donut1.Add(var.GetValorDonut1[i], var.GetPaletteBasic[i]);
            }

            donut1.Title = "pieAnimals";

            BaseChart.Chart.Axes.Left.SetMinMax(BaseChart.Chart.Axes.Left.MinYValue, BaseChart.Chart.Axes.Left.MaxYValue);
            BaseChart.Chart.Axes.Bottom.SetMinMax(BaseChart.Chart.Axes.Bottom.MinYValue, BaseChart.Chart.Axes.Bottom.MaxXValue);

            BaseChart.Chart.Axes.Bottom.Increment = 5;
            BaseChart.Chart.Axes.Left.Increment   = 5;

            BaseChart.Chart.Axes.Left.Visible         = true;
            BaseChart.Chart.Axes.Left.AxisPen.Visible = true;
            BaseChart.Chart.Axes.Left.Ticks           = new Axis.TicksPen {
                Width = 2, Visible = true, Color = Color.FromArgb(0, 200, 200, 200), EndCap = PenLineCap.Flat, Style = DashStyle.Solid, Length = 10,
            };
            BaseChart.Chart.Axes.Bottom.Visible = true;

            BaseChart.Chart.Axes.Left.Title.Angle    = 90;
            BaseChart.Chart.Axes.Left.Grid.Visible   = false;
            BaseChart.Chart.Axes.Bottom.Grid.Visible = false;
            BaseChart.Chart.Panel.MarginLeft         = 5;

            BaseChart.Chart.Legend.LegendStyle     = LegendStyles.Values;
            BaseChart.Chart.Legend.Symbol.Position = LegendSymbolPosition.Right;

            BaseChart.Chart.SubHeader.Visible      = true;
            BaseChart.Chart.SubHeader.Text         = "A";
            BaseChart.Chart.SubHeader.Font.Size    = 80;
            BaseChart.Chart.SubHeader.Color        = Color.White;
            BaseChart.Chart.SubHeader.Transparency = 100;

            // Themes Marks
            Themes.AplicarMarksTheme1(BaseChart);

            donut1.Marks.Pen.Visible                  = false;
            donut1.Marks.FollowSeriesColor            = false;
            donut1.Marks.Style                        = MarksStyles.Percent;
            donut1.Marks.Brush.Transparency           = 100;
            donut1.MarksPie.VertCenter                = true;
            donut1.Marks.Transparent                  = true;
            donut1.Marks.Frame.Transparency           = 100;
            BaseChart.Chart.Series[0].Marks.Font.Size = 18;
            donut1.MarksPie.InsideSlice               = true;
            if (App.ScreenWidth < 600)
            {
                donut1.Marks.Font.Size = 15;
            }
            else
            {
                donut1.Marks.Font.Size = 18;
            }
            BaseChart.Chart.ClickSeries += tool_dataPointSelect.DonutChart_ClickSeries;
        }
Пример #4
0
        public ZoomPanningChartFeatures(ChartView BaseChart)
        {
            // Variables
            line1                = new Line();
            var                  = new Variables.Variables();
            this.BaseChart       = BaseChart;
            tool_dataPointSelect = new Tools.DataPointSelection(BaseChart);

            // Modificación del "Chart" base
            BaseChart.Chart.ClickSeries   += null;
            BaseChart.Chart.Legend.Visible = true;
            BaseChart.Chart.Panning.Allow  = ScrollModes.Both;
            BaseChart.Chart.Panning.Active = true;
            BaseChart.Chart.Panning.Chart  = BaseChart.Chart;
            BaseChart.Chart.Zoom.Active    = true;
            BaseChart.Chart.Zoom.Zoomed    = true;
            BaseChart.Chart.Zoom.Allow     = true;
            BaseChart.Chart.Zoom.Chart     = BaseChart.Chart;
            BaseChart.Chart.Header.Text    = "Zoom and Panning a Chart";
            BaseChart.Chart.Series.Add(line1);

            line1.FillSampleValues(30);

            // Propiedades de la "line1"

            line1.LinePen.Width = 6;
            line1.LinePen.Color = var.GetPaletteBasic[0];

            line1.Pointer.Color          = var.GetPaletteBasic[0];
            line1.Pointer.InflateMargins = true;
            line1.Pointer.Visible        = true;
            line1.Pointer.HorizSize      = 11;
            line1.Pointer.VertSize       = 11;
            line1.Pointer.Pen.EndCap     = PenLineCap.Round;
            line1.Pointer.Pen.Color      = Xamarin.Forms.Color.White;
            line1.Pointer.Pen.Width      = 5;
            line1.Pointer.Style          = PointerStyles.Sphere;

            line1.SeriesColor      = var.GetPaletteBasic[0];
            line1.ClickTolerance   = 40;
            line1.RecalcOptions    = RecalcOptions.OnModify;
            line1.Title            = "Births";
            line1.DefaultNullValue = 0;
            line1.ClickPointer    += tool_dataPointSelect.PointValue_Click;
            line1.GetSeriesMark   += tool_dataPointSelect.Serie_GetSeriesMark;
            line1.VertAxis         = VerticalAxis.Both;
            line1.HorizAxis        = HorizontalAxis.Both;

            // Características de los ejes del "Chart" base
            BaseChart.Chart.Axes.Left.SetMinMax(BaseChart.Chart.Axes.Left.MinYValue - 50, BaseChart.Chart.Axes.Left.MaxYValue + 50);
            BaseChart.Chart.Axes.Bottom.SetMinMax(BaseChart.Chart.Axes.Bottom.MinXValue + 20, BaseChart.Chart.Axes.Bottom.MaxXValue - 20);
            BaseChart.Chart.Axes.Left.Labels.ValueFormat   = "0";
            BaseChart.Chart.Axes.Bottom.Labels.ValueFormat = "0";
            BaseChart.Chart.Axes.Bottom.Increment          = 1;
            BaseChart.Chart.Axes.Left.Increment            = 10;
            BaseChart.Chart.Axes.Left.Visible         = true;
            BaseChart.Chart.Axes.Left.Title           = null;
            BaseChart.Chart.Axes.Bottom.Title         = null;
            BaseChart.Chart.Axes.Left.AxisPen.Visible = false;
            BaseChart.Chart.Axes.Left.Ticks.Visible   = false;
            BaseChart.Chart.Axes.Left.Grid.Visible    = true;
            BaseChart.Chart.Legend.LegendStyle        = LegendStyles.Series;
            BaseChart.Chart.Legend.Visible            = false;
            BaseChart.Chart.Axes.Bottom.Grid.Visible  = false;
            BaseChart.Chart.Panel.MarginLeft          = 5;

            // Themes Marks
            Themes.AplicarMarksTheme1(BaseChart);
            BaseChart.Chart.Series[0].Marks.Font.Size = 18;

            ImplementiOSMarks(BaseChart.Chart);
        }