ChartAnnotationLabelDefinition Template bug

2 posts, 0 answers
  1. Eugene
    Eugene avatar
    10 posts
    Member since:
    Jun 2015

    Posted 06 May 2017 Link to this post

    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.

     

     

  2. Milena
    Admin
    Milena avatar
    226 posts

    Posted 10 May 2017 Link to this post

    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.
Back to Top