Exemplo n.º 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            Pie = new CrossPie(new CGRect(0.0, 100.0, 380.0, 380.0));

            this.View.AddSubview(Pie);

            Pie.StartAngle = 90.0;
            Pie.Add(new PieItem {
                Title = "one", Value = 1.5
            });
            Pie.Add(new PieItem {
                Title = "two", Value = 2
            });
            Pie.Add(new PieItem {
                Title = "three", Value = 2.5
            });
            Pie.Add(new PieItem {
                Title = "four", Value = 3.5
            });
            Pie.Update();

            // Perform any additional setup after loading the view, typically from a nib.
        }
Exemplo n.º 2
0
        private void displayChart(List <ReportData> report)
        {
            Pie = new CrossPie(new CGRect(0.0, 100.0, 380.0, 380.0));
            this.View.AddSubview(Pie);

            Pie.StartAngle   = 90.0;
            Pie.Title        = "Cost Pie Chart";
            Pie.IsTitleOnTop = true;
            foreach (ReportData a in report)
            {
                Pie.Add(new PieItem {
                    Title = a.CostType, Value = a.CostValue
                });
            }


            Pie.Update();


            Pie.ItemSelected += (object sender, PieItem e) =>
            {
                e.IsPull = !e.IsPull;
                e.IsBold = e.IsPull;
                Pie.Update();
            };
        }
Exemplo n.º 3
0
        public NormalPage()
        {
            Grid grid = new Grid();

            grid.BackgroundColor = Color.White;

            grid.Children.Add(Pie = new CrossPie());
            Pie.IsValueVisible    = Pie.IsNameVisible = Pie.IsValueVisible = false;

            Random rander = new Random();

            for (int i = 0; i < 5; i++)
            {
                Pie.Add(new PieItem
                {
                    Value  = rander.Next(2, 7),
                    IsPull = i == 4,
                    IsBold = true,
                    Title  = "Test",
                });
            }
            Pie.Title        = "";     //"Title";
            Pie.TitleColor   = Xamarin.Forms.Color.Gray;
            Pie.IsTitleOnTop = true;
            Pie.Update();

            Pie.ItemSelected += (object sender, PieItem e) =>
            {
                e.IsPull = !e.IsPull;
                e.IsBold = e.IsPull;
                Pie.Update();
            };

            Content = grid;
        }
Exemplo n.º 4
0
        public HHaha(IntPtr handle) : base(handle)
        {
            Pie = new CrossPie(new CGRect(0.0, 100.0, 380.0, 380.0));

            this.AddSubview(Pie);


            Pie.StartAngle = 90.0;
            Pie.Add(new PieItem {
                Title = "one", Value = 1.5
            });
            Pie.Add(new PieItem {
                Title = "two", Value = 2
            });
            Pie.Add(new PieItem {
                Title = "three", Value = 2.5
            });
            Pie.Add(new PieItem {
                Title = "four", Value = 3.5
            });
            Pie.Update();
            Pie.IsTitleOnTop = false;
        }