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

Last tile label is hidden

1 Answer 48 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Ivan Kopcanski
Top achievements
Rank 1
Ivan Kopcanski asked on 06 Sep 2010, 09:51 AM
Hello,

    Bellow you will find XAML for the chart, styles for it's tile and labels. 
It appears that label at the last tile is not shown if it's wide enough.
I've checked data bound to the label, it's OK. Please, see attached screen shot. 
Can you help us with this?

<telerikChart:RadChart x:Name="rcAgeingAnalysis"
                                   Style="{StaticResource CustomerDetailsAgeingChart}" Grid.Row="1">
                <telerikChart:RadChart.DefaultSeriesDefinition>
                    <telerikCharting:BarSeriesDefinition ItemStyle="{StaticResource CustomerDetailsAgeingBucket}" />
                </telerikChart:RadChart.DefaultSeriesDefinition>
                <telerikChart:RadChart.DefaultView>
                    <telerikCharting:ChartDefaultView>
                        <telerikCharting:ChartDefaultView.ChartLegend>
                            <telerikCharting:ChartLegend Visibility="Collapsed" />
                        </telerikCharting:ChartDefaultView.ChartLegend>
                        <telerikCharting:ChartDefaultView.ChartArea>
                            <telerikCharting:ChartArea NoDataString="{Binding NoDataLabel}" />
                        </telerikCharting:ChartDefaultView.ChartArea>
                    </telerikCharting:ChartDefaultView>
                </telerikChart:RadChart.DefaultView>
</telerikChart:RadChart>

Here are the tile styles:

<Style x:Name="CustomerDetailsAgeingBucket" TargetType="telerikCharting:Bar">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikCharting:Bar">
                    <Canvas>
                        <Rectangle x:Name="PART_DefiningGeometry" 
                                   Height="{TemplateBinding ItemActualHeight}"
                                   Width="{TemplateBinding ItemActualWidth}"
                                   RadiusX="5" 
                                   RadiusY="5" 
                                   StrokeThickness="2">
                            <Rectangle.Fill>
                                <LinearGradientBrush>
                                    <GradientStop Color="#FF2222FF" Offset="1" />
                                    <GradientStop Color="#806666FF" Offset="0" />
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <telerikCharting:SeriesItemLabel x:Name="PART_SeriesItemLabel"
                                   Style="{StaticResource CustomerDetailsAgeingBucketLabel}" />
                        <Canvas.RenderTransform>
                            <ScaleTransform x:Name="PART_AnimationTransform" ScaleY="0" />
                        </Canvas.RenderTransform>
                        <Canvas.Triggers>
                            <EventTrigger RoutedEvent="Rectangle.Loaded">
                                <EventTrigger.Actions>
                                    <BeginStoryboard>
                                        <Storyboard 
                                                    x:Name="PART_Storyboard"
                                                    BeginTime="00:00:00.5">
                                            <DoubleAnimation 
                                                        To="1" 
                                                        Storyboard.TargetName="PART_AnimationTransform" 
                                                        Storyboard.TargetProperty="ScaleY"
                                                        Duration="00:00:00.25"
                                                        BeginTime="00:00:00.1">
                                            </DoubleAnimation>
                                        </Storyboard>
                                    </BeginStoryboard>
                                </EventTrigger.Actions>
                            </EventTrigger>
                        </Canvas.Triggers>
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    
 <Style x:Key="CustomerDetailsAgeingBucketLabel" TargetType="telerikCharting:SeriesItemLabel">
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="Padding" Value="2,0" />
        <Setter Property="IsHitTestVisible" Value="False"/>
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="telerikCharting:SeriesItemLabel">
                    <Canvas>
                        <Polyline x:Name="PART_Connector"
                                      Points="{TemplateBinding ConnectorPoints}"
                                      Visibility="{TemplateBinding ConnectorVisibility}"
                                      Style="{TemplateBinding ConnectorStyle}"
                                      Stroke="{TemplateBinding Stroke}"
                                      StrokeThickness="{TemplateBinding StrokeThickness}" />
                        <Border x:Name="PART_TextContainer"
                                    Canvas.Left="{TemplateBinding TextContainerCanvasLeft}"
                                    Canvas.Top="{TemplateBinding TextContainerCanvasTop}"
                                    Style="{TemplateBinding LabelStyle}"
                                    BorderBrush="{TemplateBinding Stroke}"
                                    Background="Transparent">
                            <TextBlock TextAlignment="{TemplateBinding HorizontalContentAlignment}"
                                           Margin="{TemplateBinding Padding}"
                                           Text="{TemplateBinding Content}" />
                        </Border>
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

1 Answer, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 09 Sep 2010, 09:27 AM
Hi Ivan,

Indeed we were able to reproduce the problematic behavior with large first / last labels getting clipped. Unfortunately we cannot suggest you a workaround for the time being but we will log this issue in our public issue tracking system and we will forward it to our developers for further review.

Sorry for the temporary inconvenience.


Regards,
Freddie
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart
Asked by
Ivan Kopcanski
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Share this question
or