void SetupChart() { var data = DataService.Instance.GetGroupedData("Country"); manager = new DrillDownManager(data, "YValue", "XValue"); manager.GroupNames.AddRange(new[] { "Country", "City", "Year", "Month", "Day" }); manager.BeforeDrill += Manager_BeforeDrill; manager.AfterDrill += Manager_AfterDrill; manager.Refresh(); flexChart1.BeginUpdate(); flexChart1.Name = "flexChart1"; flexChart1.ToolTip.Content = "X:{x} Y:{y}"; flexChart1.Footer.Style.Font = new Font(flexChart1.Font.FontFamily, 12); // Set x-binding and add data to the chart flexChart1.BindingX = "Name"; flexChart1.Binding = "Value"; flexChart1.Series.Clear(); flexChart1.Series.Add(new Series() { Binding = "Value" }); flexChart1.DataSource = manager.CurrentItems.Views; flexChart1.DataLabel.Style.Font = new System.Drawing.Font(FontFamily.GenericSansSerif, 10); flexChart1.DataLabel.Position = C1.Chart.LabelPosition.Top; flexChart1.DataLabel.Content = "{y}"; flexChart1.MouseClick += ChartMouseClick; flexChart1.EndUpdate(); }
void SetupChart() { Queue <string> drilldownPath = new Queue <string>(); drilldownPath.Enqueue("Year"); drilldownPath.Enqueue("Country"); List <Item> items = DataService.Instance.GetData(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(); flexChart1.BeginUpdate(); flexChart1.Name = "flexChart1"; flexChart1.ToolTip.Content = "{value}"; flexChart1.Footer.Style.Font = new Font(flexChart1.Font.FontFamily, 12); // Set x-binding and add data to the chart flexChart1.BindingX = "Name"; flexChart1.Binding = "Value"; flexChart1.Series.Clear(); flexChart1.Series.Add(new Series() { Binding = "Value" }); flexChart1.DataSource = manager.CurrentItems.Views; flexChart1.DataLabel.Style.Font = new System.Drawing.Font(FontFamily.GenericSansSerif, 10); flexChart1.DataLabel.Position = C1.Chart.LabelPosition.Top; flexChart1.DataLabel.Content = "{y}"; flexChart1.MouseClick += ChartMouseClick; flexChart1.EndUpdate(); flexPie1.BeginUpdate(); flexPie1.Name = "flexPie1"; flexPie1.ToolTip.Content = "{value}"; // Set x-binding and add data to the chart flexPie1.Binding = "Value"; flexPie1.BindingName = "Name"; flexPie1.DataLabel.Position = C1.Chart.PieLabelPosition.Center; flexPie1.DataLabel.Border = true; flexPie1.DataLabel.Content = "{name} | {y}"; flexPie1.DataSource = manager.CurrentItems.Views; flexPie1.MouseClick += ChartMouseClick; flexPie1.EndUpdate(); }