Tooltip for line chart

8 posts, 0 answers
  1. Manishkumar
    Manishkumar avatar
    240 posts
    Member since:
    Feb 2009

    Posted 07 Jan 2011 Link to this post

    Hi,

    I have turned on show tooltip property to true for line chart in custom chart(4 line series + stack series). But when i hover last point in line chart though it is plotted correctly, doesnt display value correctly. It is displaying value of previous point.In this case, I had set show point marks = false.

    Please help.

    Thanks and Regards,
    Manish
  2. Evgeni "Zammy" Petrov
    Admin
    Evgeni "Zammy" Petrov avatar
    168 posts

    Posted 10 Jan 2011 Link to this post

    Hi Manishkumar,

     When you hover over a line, the data point that is used as a context is the previous one.
    So if you hover over the last line segment you will get information for the data point before the last one.
    To get tooltip for the last one you will need to hover over its label or data point.

    If you do not get tooltip for last data point from its label or point mark, please send us a project so we can check it out.

    All the best,
    Evgeni "Zammy" Petrov
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. Michal
    Michal avatar
    3 posts
    Member since:
    Jan 2011

    Posted 11 May 2011 Link to this post

    Hi!

    I've encountered the same problem. Is it possible to disable showing of the tooltip when mouse is over a line and only show it when it's over a point on a line?

    thanks
    Michal
  4. Missing user
    Missing user avatar

    Posted 16 May 2011 Link to this post

    Hello,

    You can remove the tooltip for the line and to leave it for the PointMark by retemplating the style of the Line. For example:
    <UserControl.Resources>
        <Style x:Key="MyLineStyle"
               TargetType="telerik:Line">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="telerik:Line">
                        <Canvas x:Name="PART_MainContainer">
                            <telerik:PointMark x:Name="PART_PointMark"
                                               Canvas.Top="{TemplateBinding StartPointY}"
                                               PointMarkCanvasLeft="{TemplateBinding PointMarkCanvasLeft}"
                                               PointMarkCanvasTop="{TemplateBinding PointMarkCanvasTop}"
                                               Visibility="{TemplateBinding PointMarkVisibility}"
                                               ShapeStyle="{TemplateBinding PointMarkShapeStyle}"
                                               Style="{TemplateBinding PointMarkItemStyle}" />
                        </Canvas>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>

    and set this style for RadChart.DefaultSeriesDefinition.ItemStyle:
    RadChart.DefaultSeriesDefinition = new LineSeriesDefinition()
    {
        ItemStyle = this.Resources["MyLineStyle"] as Style,
        ShowItemToolTips = true
    };

    Kind regards,
    Polina
    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
  5. Martin Roussel
    Martin Roussel avatar
    246 posts
    Member since:
    Jan 2010

    Posted 22 Sep 2011 Link to this post

    Hi, i have a similar problem (using Q3 2010 SP1) but in my case, it is not showing the previous point but like 13 behind. My serie has 117 points in total and finishes with the following Y values (in acending order): ....3712, 3720, 3720,3721,3721,3722,3722,3723,3723,2724,3724. Maybe im not aiming with my cursor enough to hit the end but the highest value i get in my tooltip is 3712 when hovering the really end. The problem seems worse the more we add points to the serie. When i add more point (7451 points in total), Im also experiencing some tooltip not appearing at all when putting the cursor on the line...it finally appears when hovering by the 3/4 of the line.

    If i cant fix it, is there a way i can put a static tooltip at the end on the line with the highest value? If not, the only i see is forcing a label in the legend serie's tooltip.


    Reply to Evgeni "Zammy" Petrov : what do you mean by "hover over its label"? Im not sure what is the label you mean?

    TIA
  6. Missing user
    Missing user avatar

    Posted 27 Sep 2011 Link to this post

    Hello Martin Roussel,

    I tried to reproduce this issue in local tests, but it works as expected. In the attached file you can find my test project. If you still encounter this issue, could you please modify it to replicate the unwanted behavior or submit another working project that demonstrates it? We will debug it locally, and advise you further.

    Regards,
    Polina
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  7. Martin Roussel
    Martin Roussel avatar
    246 posts
    Member since:
    Jan 2010

    Posted 30 Sep 2011 Link to this post

    Thanks for the reply Polina.

    The first differences i can see right from the start is im not using itemssource binding to map my dataset to the chart. Im creating manually the points (point = New DataPoint), the series (seriesData.Add(point)) and adding them to the chart after (xChart.DefaultView.ChartArea.DataSeries.Add(seriesData)). Maybe source binding work better? So i tried to replicate your code in VB, but weird results

    Public Class DummyData
     
        Private mdblXValue As Double
        Private mdblYValue As Double
     
        Public Property XValue() As Double
            Get
                Return mdblXValue
            End Get
            Set(ByVal value As Double)
                mdblXValue = value
            End Set
        End Property
     
        Public Property YValue() As Double
            Get
                Return mdblYValue
            End Get
            Set(ByVal value As Double)
                mdblYValue = value
            End Set
        End Property
     
    End Class
    .
    .
    .
     
                           newlist = New List(Of DummyData)
     
                                For j = 0 To seriesData.Count - 1
                                    item = New DummyData
                                    item.XValue = seriesData(j).XValue
                                    item.YValue = seriesData(j).YValue
                                    newlist.Add(item)
                                Next
     
                                xChart.ItemsSource = newlist

    The chart appears but with 2 series (i dont know where the second comes from??). The real problem i have is how to use your method (list binding) when having more than 1 serie to show?

    Can you please help?
  8. Missing user
    Missing user avatar

    Posted 04 Oct 2011 Link to this post

    Hi Martin Roussel,

    Based on the information provided, I am unsure why the chart renders two series. In case this issue persists, it will be helpful if you provide more information about how you setup the chart and bind the data.

    You can populate RadChart with data in two ways:
    -- Manually, by adding chart points - DataPoints.
    -- With data binding by using SeriesMapping/ItemMapping.
    The second approach and more concrete the manual series mapping gives you a full control on how the data is bound to the chart. It also gives you the opportunity to bind to nested collections. Basically, each nested collection will be a chart series. Please note that RadChart supports nested collections via SeriesMapping.CollectionIndex property. For additional information on populating RadChart with nested collections, please refer to the following online resources:
    http://demos.telerik.com/silverlight/#Chart/Gallery/Line
    http://www.telerik.com/help/silverlight/radchart-populating-with-data-data-binding-to-nested-collections.html

    I hope this helps.

    Kind regards,
    Polina
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top