Ejemplo n.º 1
0
        private void radSpinEditor1_ValueChanged(object sender, EventArgs e)
        {
            foreach (ChartViewController controller in this.radChartView2.Controllers)
            {
                SmartLabelsController control = controller as SmartLabelsController;

                if (control != null)
                {
                    control.Strategy.DistanceToLabel = (int)this.radSpinEditor1.Value;
                    this.radChartView2.View.PerformRefresh(this.radChartView2.View, false);
                }
            }
        }
Ejemplo n.º 2
0
        public Form1()
        {
            InitializeComponent();

            this.customTableLayoutPanel1.BackColor = Color.White;

            this.radChartView1.LabelFormatting += radChartView_LabelFormatting;
            this.radChartView2.LabelFormatting += radChartView_LabelFormatting;

            this.InitializePie();

            this.radChartView1.View.Margin = new Padding(20);
            this.radChartView1.Title       = "Smart Labels OFF";
            this.radChartView2.Title       = "Smart Labels ON";
            this.radChartView1.ShowTitle   = true;
            this.radChartView2.ShowTitle   = true;
            this.radChartView1.ChartElement.TitlePosition = TitlePosition.Top;
            this.radChartView2.ChartElement.TitlePosition = TitlePosition.Top;
            this.radChartView1.ChartElement.TitleElement.TextAlignment = ContentAlignment.MiddleCenter;
            this.radChartView2.ChartElement.TitleElement.TextAlignment = ContentAlignment.MiddleCenter;
            this.radChartView1.ShowLegend = true;
            this.radChartView2.ShowLegend = true;

            this.smartLabelsController = new SmartLabelsController();
            this.radChartView2.Controllers.Add(this.smartLabelsController);

            this.radDropDownList1.SelectedIndexChanged += radDropDownList1_SelectedIndexChanged;
            List <string> chartTypes = new List <string>();

            chartTypes.Add("Pie");
            chartTypes.Add("Line");
            chartTypes.Add("Bar");
            chartTypes.Add("Scatter");

            this.radDropDownList1.DataSource = chartTypes;
        }