예제 #1
0
        protected override void SetupChart()
        {
            var items = HierarchicalDataSource.GetGroupedData("Country");

            manager = new DrillDownManager(items, "Value", "Name");
            manager.GroupNames.AddRange(new string[] { "Country", "City", "Year", "Month", "Day" });
            manager.BeforeDrill += Manager_BeforeDrill;
            manager.AfterDrill  += Manager_AfterDrill;
            manager.Refresh();

            //FlexChart settings
            flexChart1.BindingX = "Name";
            flexChart1.Binding  = "Value";
            flexChart1.Series.Add(new Series()
            {
                Name = "Value"
            });
            flexChart1.DataSource           = manager.CurrentItems.Views;
            flexChart1.ToolTip.Content      = "X:{x}\nY:{Value}";
            flexChart1.DataLabel.Style.Font = new Font("Segoe UI", 9);
            flexChart1.DataLabel.Position   = C1.Chart.LabelPosition.Top;
            flexChart1.DataLabel.Content    = "{y}";

            flexChart1.AxisY.Format      = "#,##0,K";
            flexChart1.Header.Style.Font = StyleInfo.ChartHeaderFont;
            flexChart1.MouseClick       += ChartMouseClick;
        }
예제 #2
0
        private Task <IEnumerable <object> > FetchDataAsync(int drilldownLevel)
        {
            return(System.Threading.Tasks.Task.Factory.StartNew(() =>
            {
                IEnumerable <object> data = null;
                switch (drilldownLevel)
                {
                case 0:
                    data = HierarchicalDataSource.GetGroupedData("Country", _currentValue, "City");
                    break;

                case 1:
                    data = HierarchicalDataSource.GetGroupedData("City", _currentValue, "Year");
                    break;

                case 2:
                    data = HierarchicalDataSource.GetGroupedData("Year", _currentValue, "Month");
                    break;

                case 3:
                    data = HierarchicalDataSource.GetGroupedData("Month", _currentValue, "Day");
                    break;

                default:
                    break;
                }
                return data;
            }));
        }