Пример #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;
        }
        protected override void SetupChart()
        {
            Queue <string> drilldownPath = new Queue <string>();

            drilldownPath.Enqueue("Year");
            drilldownPath.Enqueue("Country");

            var items = HierarchicalDataSource.GetFlatDataItems(500);

            manager              = new DrillDownManager(items, "Amount", "Year,Country");
            manager.BeforeDrill += Manager_BeforeDrill;
            manager.AfterDrill  += Manager_AfterDrill;
            //Triggers the AfterDrill event and update the chart as per the current DrillDownLevel
            manager.Refresh();

            //FlexChart settings
            flexChart1.BindingX = "Name";
            flexChart1.Binding  = "Value";
            flexChart1.Series.Add(new Series()
            {
                Name = "Value"
            });
            flexChart1.DataSource           = manager.CurrentItems.Views;
            flexChart1.DataLabel.Style.Font = new Font("Segoe UI", 9);
            flexChart1.DataLabel.Position   = C1.Chart.LabelPosition.Top;
            flexChart1.DataLabel.Content    = "{y:n0}";
            flexChart1.ToolTip.Active       = false;
            flexChart1.Header.Style.Font    = StyleInfo.ChartHeaderFont;
            flexChart1.MouseClick          += ChartMouseClick;

            //FlexPie settings
            _flexPie.BindingName        = "Name";
            _flexPie.Binding            = "Value";
            _flexPie.DataSource         = manager.CurrentItems.Views;
            _flexPie.DataLabel.Position = PieLabelPosition.Center;
            _flexPie.DataLabel.Content  = "{name} | {value:n0}";
            _flexPie.ToolTip.Content    = "{P:0}%";
            _flexPie.Header.Style.Font  = StyleInfo.ChartHeaderFont;
            _flexPie.MouseClick        += ChartMouseClick;
        }