Unplanned
Last Updated: 16 Jun 2021 05:10 by ADMIN
chandrasekhar
Created on: 16 Jun 2021 05:10
Category: ChartView
Type: Bug Report
0
RadChartView: Trackball's text is out of boundary box

Please use the following code snippet. You will notice that for very long text in the trackball, the fill rectangle doesn't fit the text.

PS. If the legend items occupy enough width of the chart, there wouldn't be sufficient space for the trackball.

        public RadForm1()
        {
            InitializeComponent();

            BarSeries barSeries = new BarSeries("Performance", "RepresentativeName");
            barSeries.LegendTitle = "Q1 This is some sample very long text";
            barSeries.DataPoints.Add(new CategoricalDataPoint(177, "Harley"));
            barSeries.DataPoints.Add(new CategoricalDataPoint(128, "White"));
            barSeries.DataPoints.Add(new CategoricalDataPoint(143, "Smith"));
            barSeries.DataPoints.Add(new CategoricalDataPoint(111, "Jones"));
            barSeries.DataPoints.Add(new CategoricalDataPoint(118, "Marshall")); 
            this.radChartView1.Series.Add(barSeries);
            BarSeries barSeries2 = new BarSeries("Performance", "RepresentativeName");
            barSeries2.LegendTitle = "Q2 This is some sample very long text";
            barSeries2.DataPoints.Add(new CategoricalDataPoint(153, "Harley"));
            barSeries2.DataPoints.Add(new CategoricalDataPoint(141, "White"));
            barSeries2.DataPoints.Add(new CategoricalDataPoint(130, "Smith"));
            barSeries2.DataPoints.Add(new CategoricalDataPoint(88, "Jones"));
            barSeries2.DataPoints.Add(new CategoricalDataPoint(109, "Marshall"));
            this.radChartView1.Series.Add(barSeries2);

            this.radChartView1.ShowLegend = true;
      
            ChartTrackballController trackballController = new ChartTrackballController();
            trackballController.TextNeeded += trackballController_TextNeeded;
            radChartView1.Controllers.Add(trackballController);
        }

        string text = "<html><color=200,200,200,200>This is some sample very long text that wouldn't fit in " +
                      "the default size of the RadChartView from the Telerik UI for WinForms suite</html>";

        private void trackballController_TextNeeded(object sender, TextNeededEventArgs e)
        { 
            e.Text = text;
        }

Workaround: 

            ChartTrackballController trackballController = new ChartTrackballController();
            trackballController.IsFixedSize = true;
            trackballController.FixedSize = new Size(700, 40);
            trackballController.TextNeeded += trackballController_TextNeeded;
            radChartView1.Controllers.Add(trackballController);

0 comments