RadLegend didn't show normally.

1 Answer 11 Views
ChartView
JIJIKO
Top achievements
Rank 1
Iron
JIJIKO asked on 07 Dec 2021, 02:12 AM

Hi Guys,

When i set the chartview, the RadLegend didn't show normally..

I have uploaded my solution.

Best wishes,

JIJIKO

1 Answer, 1 is accepted

Sort by
0
Stenly
Telerik team
answered on 08 Dec 2021, 02:32 PM

Hello Jijiko,

In order for the RadLegend element to display correctly in the provided project, a new instance of the DataPointLegendSettings settings would need to be set for the LegendSettings property of the BarSeries. On the mentioned data point settings, it is important to set the TitleBinding property to the CategoryBinding property's value of the used bar series. The following code snippet shows this logic included into the used series:

<telerik:RadCartesianChart.Series>
    <telerik:BarSeries ItemsSource="{Binding ItemsSource1}"
                       CategoryBinding="XCat" ValueBinding="YVal1">
        <telerik:BarSeries.LegendSettings>
            <telerik:DataPointLegendSettings TitleBinding="XCat" />
        </telerik:BarSeries.LegendSettings>
    </telerik:BarSeries>
</telerik:RadCartesianChart.Series>

Please keep in mind that the DataPointLegendSettings is only supported by the BarSeries and the BubbleSeries. Otherwise, you should use SeriesLegendSettings.

With that said, I have modified the sample project for you to test, so, could you give it a try?

Regards,
Stenly
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
ChartView
Asked by
JIJIKO
Top achievements
Rank 1
Iron
Answers by
Stenly
Telerik team
Share this question
or