none
Adding DataPoint Labels in Silverlight Line Series Chart

    Question

  • I want to display Dependent Values on line series Chart as Labels near datpoints using below Datapoint Style and iam not able to display more than 1 Char in the Textblock if have value more than 4 Chars any one please help me in regarding this style.

    <Style x:Key="LineDatapointStyle" TargetType="toolkit:LineDataPoint"> 
        <Setter Property="Background" Value="DarkGray"/> 
        <Setter Property="Template"> 
            <Setter.Value> 
                <ControlTemplate TargetType="toolkit:LineDataPoint"> 
                    <Border> 
                        <StackPanel Margin="0,-20,0,0"> 
                        <TextBlock Text="{TemplateBinding FormattedDependentValue}" Height="20" HorizontalAlignment="Center"></TextBlock> 
                        <Border BorderBrush="{TemplateBinding BorderBrush}"  BorderThickness="{TemplateBinding BorderThickness}"> 
                            <Grid> 
                                <Grid Background="Red"> 
                                    <Rectangle Stretch="Fill"> 
                                        <Rectangle.Fill> 
                                            <LinearGradientBrush> 
                                                <GradientStop Color="#77ffffff" Offset="0"/> 
                                                <GradientStop Color="#00ffffff" Offset="1"/> 
                                            </LinearGradientBrush> 
                                        </Rectangle.Fill> 
                                    </Rectangle> 
                                    <Border BorderBrush="#ccffffff" BorderThickness="1"> 
                                        <Border BorderBrush="#77ffffff" BorderThickness="1"/> 
                                    </Border> 
                                </Grid> 
                            </Grid> 
                        </Border> 
                            </StackPanel> 
                    </Border> 
                </ControlTemplate> 
            </Setter.Value> 
        </Setter> 
    </Style>
    Monday, December 05, 2011 9:07 AM

Answers

All replies

  • Hi Sandeep,

    According to your discription, I will suggest you take a look at below links on how to add a tooltip for datapoint, below articles may help.

    http://www.rajneeshnoonia.com/blog/2009/12/datapoint-tooltip-for-silverlight-chart-toolkit/

    http://www.jeff.wilcox.name/2008/12/charting-rich-tooltips/

    Best Regards,

    Tuesday, December 06, 2011 10:21 PM
    Moderator
  •             <Style x:Key="LineDatapointStyle" TargetType="toolkit:LineDataPoint">
                    <Setter Property="Background" Value="DarkGray"/>
                    <Setter Property="Width" Value="30"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="toolkit:LineDataPoint">
                                <Border>
                                    <StackPanel Margin="0,-20,0,0" >
                                        <TextBlock Text="{TemplateBinding FormattedDependentValue}" Height="20" HorizontalAlignment="Left" ></TextBlock>
                                        <Border MaxWidth="8" BorderBrush="{TemplateBinding BorderBrush}"  BorderThickness="{TemplateBinding BorderThickness}">
                                            <Grid >
                                                <Grid Background="Red">
                                                    <Rectangle Stretch="Fill">
                                                        <Rectangle.Fill>
                                                            <LinearGradientBrush>
                                                                <GradientStop Color="#77ffffff" Offset="0"/>
                                                                <GradientStop Color="#00ffffff" Offset="1"/>
                                                            </LinearGradientBrush>
                                                        </Rectangle.Fill>
                                                    </Rectangle>
                                                    <Border BorderBrush="#ccffffff" BorderThickness="1">
                                                        <Border BorderBrush="#77ffffff" BorderThickness="1"/>
                                                    </Border>
                                                </Grid>
                                            </Grid>
                                        </Border>
                                    </StackPanel>
                                </Border>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
    
    Tuesday, April 10, 2012 2:15 PM