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

ChartAnnotationLabelDefinition Template bug

1 Answer 69 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Eugene
Top achievements
Rank 1
Eugene asked on 06 May 2017, 02:28 PM

Hi! I'm trying to improve the design of CartesianGridLineAnnotation label (add background border, for example). I've written that code: 

<telerik:CartesianGridLineAnnotation Axis="{Binding ElementName=horizontalAxis}"  Value="2.8" Stroke="Blue" Label="123" StrokeThickness="1">
        <telerik:CartesianGridLineAnnotation.LabelDefinition>
                        <telerik:ChartAnnotationLabelDefinition>
                            <telerik:ChartAnnotationLabelDefinition.Template>
                                <DataTemplate>
                                    <TextBlock Text="{Binding}" />
                                </DataTemplate>
                            </telerik:ChartAnnotationLabelDefinition.Template>
                        </telerik:ChartAnnotationLabelDefinition>
                    </telerik:CartesianGridLineAnnotation.LabelDefinition>
                </telerik:CartesianGridLineAnnotation>

It seems like Text="{Binding}" doesn't works, because chart doesn't display any text. But it will display it if i replace {Binding} with some value. I've checked the binding state, by the way. It' works fine (attached picture).

I managed to play this problem on your example: https://github.com/telerik/xaml-sdk/tree/master/ChartView/SL/AnnotationsAdding. Version: 2016.2.613.1050.

 

 

1 Answer, 1 is accepted

Sort by
0
Milena
Telerik team
answered on 10 May 2017, 08:31 AM
Hello Sergei, 

We are aware of this issue - it is logged in our FeedbackPortal, where you can vote for it and track its progress. 

In the meantime, as a workaround,  you can set MinWidth and MinHeight of TextBlock inside the DataTemplate. 

Please excuse us for the inconvenience caused. 

Regards,
Milena
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ChartView
Asked by
Eugene
Top achievements
Rank 1
Answers by
Milena
Telerik team
Share this question
or