Beispiel #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_tree_map);

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            SupportActionBar.Title = GetString(Resource.String.treeMap);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            treeMap                = this.FindViewById <C1TreeMap>(Resource.Id.treeMap);
            treeMap.ChartType      = C1.Android.Chart.TreeMapType.Squarified;
            treeMap.Binding        = "sales";
            treeMap.BindingName    = "type";
            treeMap.MaxDepth       = 2;
            treeMap.ChildItemsPath = "items";
            treeMap.ItemsSource    = ChartPoint.CreateHierarchicalData();

            treeMap.DataLabel = new ChartDataLabel()
            {
                Content = "{}{type}", Position = ChartLabelPosition.Center
            };
            treeMap.DataLabel.Style.FontSize = 10;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.
            treeMap                = new C1TreeMap();
            treeMap.ChartType      = C1.iOS.Chart.TreeMapType.Squarified;
            treeMap.Binding        = "sales";
            treeMap.BindingName    = "type";
            treeMap.MaxDepth       = 2;
            treeMap.ChildItemsPath = "items";
            treeMap.ItemsSource    = SalesData.CreateHierarchicalData();
            this.Add(treeMap);

            treeMap.DataLabel = new ChartDataLabel()
            {
                Content = "{}{type}", Position = ChartLabelPosition.Center
            };
            treeMap.DataLabel.Style.FontSize = 10;
        }