Completed
Last Updated: 01 Nov 2022 13:52 by ADMIN
Release R3 2022 SP2
Desislava
Created on: 03 Aug 2022 10:27
Category: UI for WinForms
Type: Feature Request
0
RadChartView: Add functionality to wrap legend items

The ChartLegendElement displays the legend items in a StackLayoutElement which can be either vertical or horizontal.

        public RadForm1()
        {
            InitializeComponent();

            Random rand = new Random();
            List<LineSeries> list = new List<LineSeries>();
            for (var index = 1; index <= 15; index++)
            {
                LineSeries ls = new LineSeries();
                ls.LegendTitle = "Series " + index;
                list.Add(ls);
            }

            for (int index = 1; index <= 100; index++)
            {
                foreach (LineSeries s in list)
                    s.DataPoints.Add(new CategoricalDataPoint(index, rand.Next(0, rand.Next(5, 20))));
            }
            this.radChartView1.Series.AddRange(list.ToArray());
            this.radChartView1.ShowLegend = true;
            this.radChartView1.ChartElement.LegendPosition = LegendPosition.Bottom;
            this.radChartView1.ChartElement.LegendElement.StackElement.Orientation = Orientation.Vertical;
        }

Horizontal:

Vertical:

It would be good to provide an option for wrapping the legend items:

chartview-wrap-legend-items002

Workaround: use an appropriate container for the legend items to wrap the legend item and use the space more efficiently

https://docs.telerik.com/devtools/winforms/knowledge-base/chartview-wrap-legend-items 

 

0 comments