Exemplo n.º 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            picker.Model = new ChartTypesModel(this);

            chart          = new FlexChart();
            chart.BindingX = "Name";
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Sales", Binding = "Sales,Sales"
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Expenses", Binding = "Expenses,Expenses"
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Downloads", Binding = "Downloads,Downloads"
            });
            chart.ItemsSource = SalesData.GetSalesDataList();
            this.Add(chart);

            chart.SelectionMode  = ChartSelectionModeType.Series;
            chart.SelectionStyle = new ChartStyle {
                Stroke = UIColor.Red, StrokeThickness = 3
            };
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            picker.Model = new ThemeModel(this);
            picker.ShowSelectionIndicator = true;

            chart          = new FlexChart();
            chart.BindingX = "Name";
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Sales", Binding = "Sales,Sales"
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Expenses", Binding = "Expenses,Expenses"
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Downloads", Binding = "Downloads,Downloads"
            });
            chart.ItemsSource = SalesData.GetSalesDataList();
            this.Add(chart);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            picker.Model = new ChartTypesModel(this);

            chart          = new FlexChart();
            chart.BindingX = "Name";
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Sales", Binding = "Sales,Sales"
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Expenses", Binding = "Expenses,Expenses"
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Downloads", Binding = "Downloads,Downloads"
            });
            chart.ItemsSource = SalesData.GetSalesDataList();
            this.Add(chart);

            //chart.ChartType = ChartType.Area;
            //chart.Stacking = Stacking.Stacked;
        }
Exemplo n.º 4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.
            chart          = new FlexChart();
            chart.BindingX = "Name";
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Sales", Binding = "Sales,Sales"
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Expenses", Binding = "Expenses,Expenses"
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Downloads", Binding = "Downloads,Downloads"
            });
            chart.ItemsSource = SalesData.GetSalesDataList();
            this.Add(chart);
            chart.AxisX.LabelLoading += (object sender, AxisLabelLoadingEventArgs e) =>
            {
                string  path  = "Images/" + e.LabelString;
                UIImage image = null;
                try
                {
                    image = new UIImage(path);
                }
                catch (Exception)
                {
                    image = null;
                }

                UIImageView imageView = new UIImageView();
                imageView.Frame = new CGRect(0, 0, 25, 20);
                imageView.Image = image;
                e.Label         = imageView;
            };

            chart.AxisY.LabelLoading += (object sender, AxisLabelLoadingEventArgs e) =>
            {
                UILabel label = new UILabel();
                label.Text = "$" + (e.Value / 1000).ToString() + "K";
                label.AdjustsFontSizeToFitWidth = true;
                if (e.Value <= 8000)
                {
                    label.TextColor = UIColor.Red;
                }
                else if (e.Value <= 12000 && e.Value > 8000)
                {
                    label.TextColor = UIColor.Green;
                }
                else
                {
                    label.TextColor = UIColor.Black;
                }
                e.Label = label;
            };
        }
Exemplo n.º 5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.
            chart          = new FlexChart();
            chart.BindingX = "Name";
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Sales", Binding = "Sales,Sales"
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Expenses", Binding = "Expenses,Expenses"
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Downloads", Binding = "Downloads,Downloads"
            });
            chart.ItemsSource = SalesData.GetSalesDataList();
            this.Add(chart);
            chart.AxisX.LabelLoading += (object sender, RenderLabelLoadingEventArgs e) =>
            {
                string  path  = "Images/" + e.LabelString;
                UIImage image = null;
                try
                {
                    image = new UIImage(path);
                }
                catch (Exception)
                {
                    image = null;
                }
                if (image != null)
                {
                    image.Draw(new CGRect(e.Rect.Left, e.Rect.Top, e.Rect.Width, e.Rect.Height));
                }
                e.LabelString = null;
            };

            chart.AxisY.LabelLoading += (object sender, RenderLabelLoadingEventArgs e) =>
            {
                if (e.Value <= 8000)
                {
                    e.Engine.SetFill(UIColor.Red);
                }
                else if (e.Value <= 12000 && e.Value > 8000)
                {
                    e.Engine.SetFill(UIColor.Green);
                }
                else
                {
                    e.Engine.SetFill(UIColor.Black);
                }
                e.LabelString = "$" + (e.Value / 1000).ToString() + "K";
            };
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.
            chart          = new FlexChart();
            chart.BindingX = "Name";
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Sales", Binding = "Sales,Sales"
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Expenses", Binding = "Expenses,Expenses"
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Downloads", Binding = "Downloads,Downloads"
            });
            chart.ItemsSource = SalesData.GetSalesDataList();
            this.Add(chart);
            chart.Palette        = Palette.Cocoa;
            chart.Stacking       = ChartStackingType.Stacked;
            chart.LegendPosition = ChartPositionType.Bottom;

            MyTooltip t = new MyTooltip();

            t.Frame               = new CGRect(0, 0, 100, 50);
            t.BackgroundColor     = new UIColor(1.0f, 1.0f, 0.792f, 1.0f);
            chart.ToolTip         = t;
            chart.ToolTipLoading += (object sender, ChartTooltipLoadingEventArgs args) =>
            {
                ChartHitTestInfo e = args.HitTestInfo;
                if (e.Distance < 2 && e.PointIndex >= 0)
                {
                    double left = e.Point.X, top = e.Point.Y - t.Frame.Height, width = t.Frame.Width, height = t.Frame.Height;
                    double screenWidth = UIScreen.MainScreen.Bounds.Size.Width;
                    double margin      = 5;
                    if (left + width > screenWidth)
                    {
                        left = screenWidth - width - margin;
                    }
                    t.Frame = new CGRect(left, top, width, height);
                    t.UpdateContent(e);
                    t.IsOpen = true;
                }
                else
                {
                    t.IsOpen = false;
                }
            };
        }
Exemplo n.º 7
0
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     Chart.BindingX = "Name";
     Chart.Series.Add(new ChartSeries()
     {
         SeriesName = "Sales", Binding = "Sales,Sales"
     });
     Chart.Series.Add(new ChartSeries()
     {
         SeriesName = "Expenses", Binding = "Expenses,Expenses"
     });
     Chart.Series.Add(new ChartSeries()
     {
         SeriesName = "Downloads", Binding = "Downloads,Downloads"
     });
     Chart.ItemsSource = SalesData.GetSalesDataList();
 }
Exemplo n.º 8
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            chart           = new FlexChart();
            chart.ChartType = C1.iOS.Chart.ChartType.Bubble;
            chart.BindingX  = "Name";
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Sales", Binding = "Sales,Downloads"
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Expenses", Binding = "Expenses,Downloads"
            });
            chart.ItemsSource = SalesData.GetSalesDataList();
            this.Add(chart);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            chart           = new FlexChart();
            chart.ChartType = C1.iOS.Chart.ChartType.Scatter;
            chart.BindingX  = "Name";
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Sales", Binding = "Sales,Sales"
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Expenses", Binding = "Expenses,Expenses"
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Downloads", Binding = "Downloads,Downloads"
            });
            chart.ItemsSource = SalesData.GetSalesDataList();
            this.Add(chart);

            chart.Header          = "Sample Chart";
            chart.HeaderAlignment = UITextAlignment.Center;
            chart.HeaderStyle     = new ChartStyle {
                Stroke = new UIColor(0.502f, 0.016f, 0.302f, 1), FontFamily = UIFont.SystemFontOfSize(24, UIFontWeight.Bold)
            };
            chart.Footer          = "2017 GrapeCity, Inc.";
            chart.FooterAlignment = UITextAlignment.Center;
            chart.FooterStyle     = new ChartStyle {
                Stroke = new UIColor(0.502f, 0.016f, 0.302f, 1), FontFamily = UIFont.SystemFontOfSize(16, UIFontWeight.Bold)
            };

            chart.AxisX.Title      = "Country";
            chart.AxisX.MajorGrid  = true;
            chart.AxisX.TitleStyle = new ChartStyle {
                FontFamily = UIFont.ItalicSystemFontOfSize(16)
            };
            chart.AxisY.AxisLine = true;
            chart.AxisY.Labels   = true;
        }
Exemplo n.º 10
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.
            chart          = new FlexChart();
            chart.BindingX = "Name";
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Sales", Binding = "Sales,Sales"
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Expenses", Binding = "Expenses,Expenses"
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Downloads", Binding = "Downloads,Downloads"
            });
            chart.ItemsSource = SalesData.GetSalesDataList();
            this.Add(chart);
            chart.Palette        = Palette.Cocoa;
            chart.Stacking       = ChartStackingType.Stacked;
            chart.LegendPosition = ChartPositionType.Bottom;

            MyTooltip t = new MyTooltip();

            t.Frame           = new CGRect(0, 0, 100, 50);
            t.BackgroundColor = new UIColor(1.0f, 1.0f, 0.792f, 1.0f);

            chart.ToolTipLoading += (object sender, ChartTooltipLoadingEventArgs args) =>
            {
                ChartHitTestInfo e = args.HitTestInfo;
                if (e.Distance < 2 && e.PointIndex >= 0)
                {
                    t.UpdateContent(e);
                }
                args.view = t;
            };
        }
Exemplo n.º 11
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            chart          = new FlexChart();
            chart.BindingX = "Name";
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Sales",
                Binding    = "Sales,Sales",
                Style      = new ChartStyle {
                    Fill = new UIColor(0, 0.8f, 0, 1), Stroke = UIColor.Green, StrokeThickness = 2
                }
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Expenses",
                Binding    = "Expenses,Expenses",
                Style      = new ChartStyle {
                    Fill = UIColor.Red, Stroke = new UIColor(0.702f, 0, 0, 1), StrokeThickness = 2
                }
            });
            chart.Series.Add(new ChartSeries()
            {
                SeriesName = "Downloads",
                Binding    = "Downloads,Downloads",
                ChartType  = ChartType.LineSymbols,
                Style      = new ChartStyle {
                    Fill = new UIColor(1, 0.416f, 1, 1), Stroke = UIColor.Blue, StrokeThickness = 10
                },
                SymbolStyle = new ChartStyle {
                    Fill = UIColor.Yellow, Stroke = UIColor.Yellow, StrokeThickness = 5
                }
            });
            chart.ItemsSource = SalesData.GetSalesDataList();
            this.Add(chart);
        }