This is a migrated thread and some comments may be shown as answers.

RadCartesianChart BarSeries LabelDefinition Resize

2 Answers 88 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Benedikt
Top achievements
Rank 3
Iron
Iron
Iron
Benedikt asked on 23 Jan 2020, 10:10 AM

Hey,

 

I have a Chart with multiple stacked BarSeries. My Top series has to Labels, one to display its own value, one for the sum of the stacked ones combines.

The problem is, that this:

                        <telerik:ChartSeriesLabelDefinition HorizontalAlignment="Center" VerticalAlignment="Top" >
                            <telerik:ChartSeriesLabelDefinition.Template>
                                <DataTemplate>
                                    <TextBlock Text="{Binding DataItem.ReklasGesamt}" FontWeight="Bold" />
                                </DataTemplate>
                            </telerik:ChartSeriesLabelDefinition.Template>
                        </telerik:ChartSeriesLabelDefinition>
Won't resize if the value changes. So if the value was two digits and gets three it will cut off.

If I don't spezify a template it will resize, but will obviously not display the value I want.

Is there any way to get the label to resize? Ordo I have to add a invisble Pointseries?

 

Greetings

Benedikt

2 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 28 Jan 2020, 07:44 AM

Hello Benedikt,

Thank you for the provided code snippet.

This behavior comes from the caching mechanism of control. I would suggest checking the Resolve Axis Labels Clipping help article which describes this behavior and provide a workaround. 

Regards,
Dinko
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Benedikt
Top achievements
Rank 3
Iron
Iron
Iron
answered on 30 Jan 2020, 07:22 AM

Hey Dinko,

 

sadly not managed to get it to work that way.
But found another way: I just moved the Binding and don't use a Template
                        <telerik:ChartSeriesLabelDefinition 
                            HorizontalAlignment="Center" 
                            VerticalAlignment="Top" 
                            Binding="ReklasGesamt"
                            />
This way, it resizes. It isn't bold anymore, but that's fine.

 

Greetings

Benedikt

Tags
Chart
Asked by
Benedikt
Top achievements
Rank 3
Iron
Iron
Iron
Answers by
Dinko | Tech Support Engineer
Telerik team
Benedikt
Top achievements
Rank 3
Iron
Iron
Iron
Share this question
or