예제 #1
0
        public BasicCalendarChart(ChartViewRender BaseChart, Label label)
        {
            calendar          = new Steema.TeeChart.Styles.Calendar();
            swipeGesture      = new SwipeGesture(label);
            labelHeader       = (label as LabelSwipe);
            labelHeader.Chart = BaseChart.Chart;
            this.BaseChart    = BaseChart;

            labelHeader.Text = MyConvert.NumericMonthToString(calendar.Date.Month) + ", " + calendar.Date.Year.ToString();
            BaseChart.Chart.Header.Font.Size = 25;
            labelHeader.TextColor            = Color.FromRgb(70, 70, 70);
            BaseChart.Chart.Header.Text      = "BasicCalendar";
            BaseChart.Chart.Header.Visible   = false;

            calendar.FillSampleValues();
            BaseChart.Chart.Series.Add(calendar);
            calendar.PreviousMonthButton.Visible = false;
            calendar.NextMonthButton.Visible     = false;
            calendar.Trailing.Color      = Color.FromRgb(200, 200, 200);
            calendar.Trailing.Font.Size  = 14;
            calendar.Today.Color         = Color.FromRgb(210, 210, 210);
            calendar.Today.Font.Color    = Color.Black;
            calendar.Today.Font.Size     = 14;
            calendar.WeekDays.Font.Size  = 16;
            calendar.WeekDays.Font.Color = Color.FromRgb(150, 150, 150);
            calendar.WeekDays.TextAlign  = TextAlignment.Start;
            calendar.WeekDays.Pen.Width  = 1;
            calendar.Days.Font.Size      = 14;
            calendar.Days.TextAlign      = TextAlignment.Start;
            calendar.WeekDays.Color      = Color.Transparent;
            calendar.Sunday.Color        = Color.Transparent;
            calendar.Sunday.Font.Size    = 14;
            calendar.Sunday.Font.Color   = Color.Black;
            calendar.Sunday.Pen.Width    = 0;
            calendar.Sunday.Pen.Visible  = false;
            calendar.Months.Visible      = false;

            //calendar.Active = true;

            BaseChart.Chart.ClickSeries += Chart_ClickSeries;

            BaseChart.Chart.Panning.Active = true;

            NextBackButtonsUpdate();
        }
예제 #2
0
        public SpecialDatesChart(ChartView BaseChart, Label label)
        {
            calendar       = new Steema.TeeChart.Styles.Calendar();
            this.BaseChart = BaseChart;
            labelHeader    = label as LabelSwipe;
            swipeGesture   = new Services.Gesture.Swipe.SwipeGesture(labelHeader);

            labelHeader.Text = DateTime.Today.ToShortDateString();

            BaseChart.Chart.Header.TextAlign = TextAlignment.End;
            BaseChart.Chart.Header.Visible   = false;
            labelHeader.TextColor            = Color.FromRgb(170, 100, 100);
            BaseChart.Chart.Header.Text      = "SpecialCalendar";

            BaseChart.Chart.SubHeader.Visible      = true;
            BaseChart.Chart.SubHeader.Text         = "Hola";
            BaseChart.Chart.SubHeader.Font.Size    = 15;
            BaseChart.Chart.SubHeader.Transparency = 100;

            calendar.FillSampleValues();
            BaseChart.Chart.Series.Add(calendar);
            calendar.PreviousMonthButton.Visible = false;
            calendar.NextMonthButton.Visible     = false;
            calendar.Trailing.Color      = Color.FromRgb(200, 200, 200);
            calendar.Trailing.Font.Size  = 14;
            calendar.Today.Color         = Color.FromRgb(255, 240, 240);
            calendar.Today.Font.Color    = Color.Black;
            calendar.Today.Font.Size     = 14;
            calendar.Today.BorderRound   = 90;
            calendar.WeekDays.Font.Size  = 15;
            calendar.WeekDays.Font.Color = Color.FromRgb(180, 100, 100);
            calendar.WeekDays.TextAlign  = TextAlignment.Start;
            calendar.WeekDays.Pen.Width  = 1;
            calendar.WeekDays.UpperCase  = true;
            calendar.Days.Font.Size      = 14;
            calendar.Days.TextAlign      = TextAlignment.Start;
            calendar.WeekDays.Color      = Color.FromRgb(250, 230, 230);
            calendar.Sunday.Color        = Color.Red;
            calendar.Sunday.Font.Size    = 16;
            calendar.Sunday.Font.Color   = Color.White;
            calendar.Sunday.ShapeStyle   = TextShapeStyle.Rectangle;
            //calendar.Sunday.Brush.Style = HatchStyle.DiagonalBrick;
            //calendar.Sunday.Brush.ForegroundColor = Color.Green;
            //calendar.Sunday.Brush.Color = Color.Red;
            //calendar.Sunday.Brush.Visible = true;
            //calendar.Sunday.Brush.Solid = false;
            calendar.Sunday.Color            = Color.FromRgb(235, 160, 160);
            calendar.Sunday.Gradient.Visible = false;
            calendar.Sunday.Pen.Visible      = false;
            calendar.Months.Visible          = false;
            calendar.Pen.Visible             = true;
            calendar.Pen.Width   = 3;
            calendar.Pen.Style   = DashStyle.DashDot;
            calendar.Pen.DashCap = PenLineCap.Round;
            calendar.Pen.Color   = Color.FromRgb(200, 130, 130);

            BaseChart.Chart.ClickSeries += Chart_ClickSeries;
            //calendar.BeforeDrawValues += calendar_BeforeDrawValues;

            NextBackButtonsUpdate();
        }
        private void CrearChart1VegadaPagina()
        {
            grid             = new Grid();
            stackLayoutChart = new StackLayout();

            this.ToolbarItems.Add(InicialitzarAboutChartToolbar());
            if (valorInicial != 5 && valorInicial != 7 && valorInicial != 8 && valorInicial != 9 && valorInicial != 11 && valorInicial != 12 && valorInicial != 13)
            {
                if (Device.RuntimePlatform != Device.UWP)
                {
                    this.ToolbarItems.Add(InicialitzarConfigToolBar());
                }
            }

            // StackLayout del "Chart"
            stackLayoutChart.Margin            = 0;
            stackLayoutChart.VerticalOptions   = LayoutOptions.FillAndExpand;
            stackLayoutChart.HorizontalOptions = LayoutOptions.FillAndExpand;

            // "Grid" de la pestaña Types

            grid.HorizontalOptions = LayoutOptions.FillAndExpand;
            grid.VerticalOptions   = LayoutOptions.FillAndExpand;
            grid.ColumnSpacing     = 0;
            grid.RowSpacing        = 0;
            grid.Margin            = 0;

            switch (valorInicial)
            {
            case 3:
                menuInferior = new MenuInferior(var.GetCircularGaugesNomButtons);
                break;

            case 4:
                menuInferior = new MenuInferior(var.GetMapsNomButtons);
                break;

            case 5:
                menuInferior = new MenuInferior(var.GetTreeMapNomButtons);
                break;

            case 6:
                menuInferior = new MenuInferior(var.GetKnobGaugeNomButtons);
                break;

            case 7:
                menuInferior = new MenuInferior(var.GetClockNomButtons);
                break;

            case 8:
                menuInferior = new MenuInferior(var.GetOrganizationalNomButtons);
                break;

            case 9:
                menuInferior = new MenuInferior(var.GetNumericGaugeNomButtons);
                break;

            case 10:
                menuInferior = new MenuInferior(var.GetLinearGaugeNomButtons);
                break;

            case 11:
                menuInferior = new MenuInferior(var.GetCalendarNomButtons);
                break;

            case 12:
                menuInferior = new MenuInferior(var.GetSparkLinesNomButtons);
                break;

            case 13:
                menuInferior = new MenuInferior(var.GetTagCloudNomButtons);
                break;

            case 14:
                menuInferior = new MenuInferior(var.GetStandardFunctionsNomButtons);
                break;
            }

            this.Title = menuInferior.GetNomButtons[0];

            switch (valorInicial)
            {
            case 5:
            case 8:
            case 9:
            case 13:

                grid.RowDefinitions.Add(new RowDefinition {
                    Height = new GridLength(1, GridUnitType.Star)
                });
                grid.ColumnDefinitions.Add(new ColumnDefinition {
                    Width = new GridLength(1, GridUnitType.Star)
                });
                vChart = new ChartViewBase(this.Title);
                stackLayoutChart.Children.Add(vChart.GetChart);
                grid.Children.Add(stackLayoutChart, 0, 0);
                break;

            case 11:

                LabelSwipe labelHeader  = new LabelSwipe();
                Button     btnBackMonth = new Button();
                Button     btnNextMonth = new Button();

                btnBackMonth.Text              = "<";
                btnBackMonth.VerticalOptions   = LayoutOptions.FillAndExpand;
                btnBackMonth.HorizontalOptions = LayoutOptions.Start;
                btnBackMonth.WidthRequest      = 50;
                btnNextMonth.Text              = ">";
                btnNextMonth.VerticalOptions   = LayoutOptions.FillAndExpand;
                btnNextMonth.HorizontalOptions = LayoutOptions.End;
                btnNextMonth.WidthRequest      = 50;

                grid.ColumnDefinitions.Add(new ColumnDefinition {
                    Width = new GridLength(1, GridUnitType.Star)
                });

                if (Device.RuntimePlatform == Device.Android || Device.RuntimePlatform == Device.UWP)
                {
                    grid.RowDefinitions.Add(new RowDefinition {
                        Height = new GridLength(0.11, GridUnitType.Star)
                    });
                    grid.RowDefinitions.Add(new RowDefinition {
                        Height = new GridLength(0.79, GridUnitType.Star)
                    });
                    grid.RowDefinitions.Add(new RowDefinition {
                        Height = new GridLength(0.11, GridUnitType.Star)
                    });

                    grid.Children.Add(labelHeader, 0, 0);
                    grid.Children.Add(btnBackMonth, 0, 0);
                    grid.Children.Add(btnNextMonth, 0, 0);
                    grid.Children.Add(stackLayoutChart, 0, 1);
                    grid.Children.Add(menuInferior.GetScrollView, 0, 2);
                }
                else
                {
                    grid.RowDefinitions.Add(new RowDefinition {
                        Height = new GridLength(0.08, GridUnitType.Star)
                    });
                    grid.RowDefinitions.Add(new RowDefinition {
                        Height = new GridLength(0.81, GridUnitType.Star)
                    });
                    grid.RowDefinitions.Add(new RowDefinition {
                        Height = new GridLength(0.11, GridUnitType.Star)
                    });

                    btnBackMonth.BorderWidth = 1;
                    btnBackMonth.BorderColor = Color.FromRgb(100, 100, 100);
                    btnNextMonth.BorderWidth = 1;
                    btnNextMonth.BorderColor = Color.FromRgb(100, 100, 100);
                    grid.Children.Add(labelHeader, 0, 2);
                    grid.Children.Add(btnBackMonth, 0, 2);
                    grid.Children.Add(btnNextMonth, 0, 2);
                    grid.Children.Add(stackLayoutChart, 0, 1);
                    grid.Children.Add(menuInferior.GetScrollView, 0, 0);
                }

                vChart = new ChartViewBase(this.Title, labelHeader);
                stackLayoutChart.Children.Add(vChart.GetChart);
                AsignarClickEvent(valorInicial);
                break;

            default:

                grid.ColumnDefinitions.Add(new ColumnDefinition {
                    Width = new GridLength(1, GridUnitType.Star)
                });

                switch (Device.RuntimePlatform)
                {
                case Device.Android:
                case Device.UWP:
                    grid.RowDefinitions.Add(new RowDefinition {
                        Height = new GridLength(0.89, GridUnitType.Star)
                    });
                    grid.RowDefinitions.Add(new RowDefinition {
                        Height = new GridLength(0.11, GridUnitType.Star)
                    });
                    grid.Children.Add(stackLayoutChart, 0, 0);
                    grid.Children.Add(menuInferior.GetScrollView, 0, 1);
                    break;

                case Device.iOS:
                    grid.RowDefinitions.Add(new RowDefinition {
                        Height = new GridLength(0.08, GridUnitType.Star)
                    });
                    grid.RowDefinitions.Add(new RowDefinition {
                        Height = new GridLength(0.92, GridUnitType.Star)
                    });
                    grid.Children.Add(stackLayoutChart, 0, 1);
                    grid.Children.Add(menuInferior.GetScrollView, 0, 0);
                    break;

                default:
                    throw new Exception("Unexpected Case");
                }

                vChart = new ChartViewBase(menuInferior.GetButtons[0]);
                stackLayoutChart.Children.Add(vChart.GetChart);

                AsignarClickEvent(valorInicial);
                break;
            }

            this.Content = grid;
        }