CustomGridLine Tooltip is not working

2 posts, 0 answers
  1. Muthukumar
    Muthukumar avatar
    15 posts
    Member since:
    Oct 2011

    Posted 23 Jan 2012 Link to this post

    hi team,
    i have a Telerik Radchart. i have bound data for the Line series into that chart. i have enable the  ShowItemToolTips="True" for the series and it was working fine.

    Above that i have two custom grid lines. i need to have the tooltip service for the customgridlines. i have tried the ToolTipService.ToolTip="My Tooltip"  but its not working. i guess the lines are not even focused. i cant raise the event when MouseEnter,MouseLeave and MouseLeftButtonDown. here is my code, Thanks in Advance

    <Border Grid.Row="3">
                                        <telerik:RadBusyIndicator x:Name="radBusy1"
                                                Background="Transparent"
                                                BorderBrush="Transparent"
                                                Width="Auto" Margin="10,10,40,0"
                                                FontFamily="Calibri" FontSize="14"
                                                Height="300" VerticalAlignment="Top">
                                            <telerik:RadChart x:Name="RadChart1"
                                                    ItemsSource="{Binding GasLiftInjectionData}"
                                                    Background="{x:Null}"
                                                    BorderBrush="{x:Null}"
                                                    Margin="2">
                                                <telerik:RadChart.DefaultView>
                                                    <telerik:ChartDefaultView
                                                            ChartLegendPosition="Bottom">
                                                        <telerik:ChartDefaultView.ChartTitle>
                                                            <telerik:ChartTitle
                                                                    Visibility="Collapsed" />
                                                        </telerik:ChartDefaultView.ChartTitle>
                                                        <telerik:ChartDefaultView.ChartArea>
                                                            <telerik:ChartArea
                                                                    LegendName="legend"
                                                                    NoDataString="{Binding DataLoading}" LabelFormatBehavior="None">
                                                                <telerik:ChartArea.Annotations>
                                                                    <telerik:CustomGridLine ToolTipService.ToolTip="My Tooltip"
                                                                            YIntercept="{Binding GLTargetHigh}"
                                                                            Stroke="Red"
                                                                            StrokeThickness="3" />
                                                                    <telerik:CustomGridLine ToolTipService.ToolTip="My Tooltip"
                                                                            YIntercept="{Binding GLTargetLow}"
                                                                            Stroke="Orange"
                                                                            StrokeThickness="3" />
                                                                </telerik:ChartArea.Annotations>
     
                                                                <telerik:ChartArea.AxisY>
                                                                    <telerik:AxisY
                                                                           DefaultLabelFormat="#VAL{0.000}"
                                                                            AutoRange="False"
                                                                            MajorGridLinesVisibility="Visible"
                                                                            MinorGridLinesVisibility="Collapsed"
                                                                            MinValue="{Binding YaxisMinValue}"
                                                                            MaxValue="{Binding YaxisMaxValue}"
                                                                            Step="{Binding YaxisStepValue}"
                                                                            IsLogarithmic="False">
                                                                        <telerik:AxisY.AxisStyles>
                                                                            <telerik:AxisStyles
                                                                                    MinorTickLineStyle="{StaticResource MinorTickLineStyle}"
                                                                                    TickLineStyle="{StaticResource TickLineStyle}"
                                                                                    AxisLineStyle="{StaticResource AxisGridLineStyle}"
                                                                                    ItemLabelStyle="{StaticResource YaxisItemLabelStyleGrey}"
                                                                                    AlternateStripLineStyle="{StaticResource HorizontalAlternateStripLineStyle}"
                                                                                    StripLineStyle="{StaticResource HorizontalStripLineStyle}"
                                                                                    GridLineStyle="{StaticResource AxisGridLineStyle}" />
                                                                        </telerik:AxisY.AxisStyles>
                                                                    </telerik:AxisY>
                                                                </telerik:ChartArea.AxisY>
                                                                <telerik:ChartArea.AxisX>
                                                                    <telerik:AxisX
                                                                            IsDateTime="True"
                                                                            MinValue="{Binding XaxisMinValue}"
                                                                            MaxValue="{Binding XaxisMaxValue}"
                                                                            Step="{Binding XaxisStepValue}"
                                                                            LabelStep="1"
                                                                            DefaultLabelFormat="{Binding GLLabelFormat}"
                                                                            LabelRotationAngle="0"
                                                                            MajorGridLinesVisibility="Visible"
                                                                            MinorTicksVisibility="Visible"
                                                                            AutoRange="False">
     
                                                                        <i:Interaction.Triggers>
                                                                            <i:EventTrigger
                                                                                    EventName="RangeChanged">
                                                                                <i:InvokeCommandAction
                                                                                        Command="{Binding AxisXGridLineCommand}"
                                                                                        CommandParameter="{Binding ElementName=RadChart1}" />
                                                                            </i:EventTrigger>
                                                                        </i:Interaction.Triggers>
     
                                                                        <telerik:AxisX.AxisStyles>
                                                                            <telerik:AxisStyles
                                                                                    AxisLineStyle="{StaticResource AxisGridLineStyle}"
                                                                                    ItemLabelStyle="{StaticResource YaxisItemLabelStyleGrey}"
                                                                                    TickLineStyle="{StaticResource TickLineStyle}"
                                                                                    MinorTickLineStyle="{StaticResource MinorTickLineStyle}"
                                                                                    StripLineStyle="{StaticResource HorizontalStripLineStyle}"
                                                                                    GridLineStyle="{StaticResource AxisGridLineStyle}" />
                                                                        </telerik:AxisX.AxisStyles>
                                                                    </telerik:AxisX>
     
                                                                </telerik:ChartArea.AxisX>
                                                            </telerik:ChartArea>
                                                        </telerik:ChartDefaultView.ChartArea>
     
                                                        <telerik:ChartDefaultView.ChartLegend>
                                                            <telerik:ChartLegend
                                                                    x:Name="chartLegendTwo"
                                                                    Header=""
                                                                    UseAutoGeneratedItems="False"
                                                                    VerticalAlignment="Center"
                                                                    Background="{x:Null}"
                                                                    Width="500"
                                                                    Height="50"
                                                                    BorderBrush="{x:Null}">
     
                                                                <telerik:ChartLegend.Items>
     
                                                                    <telerik:ChartLegendItem
                                                                            MarkerFill="Yellow"
                                                                            Foreground="Yellow"
                                                                            FontSize="12"
                                                                            FontFamily="Calibri"
                                                                            Style="{StaticResource CustomLegendItem}"
                                                                            Label="Actual" />
     
                                                                    <telerik:ChartLegendItem
                                                                            MarkerFill="Red"
                                                                            Foreground="Red"
                                                                            FontSize="12"
                                                                            FontFamily="Calibri"
                                                                            Style="{StaticResource CustomLegendItem}"
                                                                            Label="High High" />
     
                                                                    <telerik:ChartLegendItem
                                                                            MarkerFill="Orange"
                                                                            Foreground="Orange"
                                                                            Label="Low Low"
                                                                            FontSize="12"
                                                                            FontFamily="Calibri"
                                                                            Style="{StaticResource CustomLegendItem}" />
     
                                                                </telerik:ChartLegend.Items>
     
                                                            </telerik:ChartLegend>
                                                        </telerik:ChartDefaultView.ChartLegend>
     
                                                    </telerik:ChartDefaultView>
                                                </telerik:RadChart.DefaultView>
                                                <telerik:RadChart.SeriesMappings>
                                                    <telerik:SeriesMapping
                                                            LegendLabel="Actual">
                                                        <telerik:SeriesMapping.SeriesDefinition>
                                                            <telerik:LineSeriesDefinition
                                                                    ShowItemToolTips="True"
                                                                    ShowPointMarks="True"
                                                                    ShowItemLabels="False">
                                                                <telerik:LineSeriesDefinition.Appearance>
                                                                    <telerik:SeriesAppearanceSettings
                                                                            Stroke="Yellow"
                                                                            Foreground="Yellow">
                                                                        <telerik:SeriesAppearanceSettings.PointMark>
                                                                            <telerik:PointMarkAppearanceSettings
                                                                                    Stroke="Transparent"
                                                                                    Fill="Transparent"
                                                                                    Shape="Hexagon" />
                                                                        </telerik:SeriesAppearanceSettings.PointMark>
                                                                    </telerik:SeriesAppearanceSettings>
                                                                </telerik:LineSeriesDefinition.Appearance>
                                                            </telerik:LineSeriesDefinition>
                                                        </telerik:SeriesMapping.SeriesDefinition>
                                                        <telerik:ItemMapping
                                                                FieldName="WhpValue"
                                                                DataPointMember="YValue" />
                                                        <telerik:ItemMapping
                                                                FieldName="DisplayDateTime"
                                                                DataPointMember="XValue" />
                                                    </telerik:SeriesMapping>
     
                                                </telerik:RadChart.SeriesMappings>
                                            </telerik:RadChart>
                                        </telerik:RadBusyIndicator>
                                    </Border>


  2. Evgenia
    Admin
    Evgenia avatar
    1406 posts

    Posted 26 Jan 2012 Link to this post

    Hello,

    Have you seen our help topic which describes this with source code provided?

    All the best,
    Evgenia
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft banner
Back to Top