Show relative tooltips once hover on Legend

6 posts, 1 answers
  1. Brad
    Brad  avatar
    3 posts
    Member since:
    Mar 2014

    Posted 01 Mar Link to this post

    I want that once user mouse over the legend item, the related series item will highlighted and show the same tooltips as they are hovered. I'm using the version 2016 Q1, but there is no OnLegendItemHover event, how?

    And how to make the databind template for Legend?

    Thanks
  2. Dimitar
    Admin
    Dimitar avatar
    281 posts

    Posted 04 Mar Link to this post

    Hi,

    We will need more time to answer to your query. As soon as we are ready we will let you know in this thread.

    Regards,
    Dimitar
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1492 posts

    Posted 07 Mar Link to this post

    Hello Brad,

    You can handle the legendItemHover event of the chart where you can get the data value and the point index:

    ASPX:
    <script>
        function legendHover(e) {
            alert(e.series.data[e.pointIndex].value);
        }
    </script>
    <telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" Width="600" Height="400">
        <ClientEvents OnLegendItemHover="legendHover" />
        <PlotArea>
            <Series>
                <telerik:PieSeries>
                    <SeriesItems>
                        <telerik:PieSeriesItem Y="30" Name="item 1" />
                        <telerik:PieSeriesItem Y="10" Name="item 2"/>
                        <telerik:PieSeriesItem Y="20" Name="item 3"/>
                    </SeriesItems>
                </telerik:PieSeries>
            </Series>
        </PlotArea>
    </telerik:RadHtmlChart>

    After that you can use RadToolTip, for example to display the hovered data. The native chart tooltip, however, is available only when hovering chart items.

    Regarding the template for the legend the feature will be available for the Q2 2016 release. For the time being you can use the workaround from this feedback item - http://feedback.telerik.com/Project/108/Feedback/Details/54488

    Regards,
    Danail Vasilev
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  5. Brad
    Brad  avatar
    3 posts
    Member since:
    Mar 2014

    Posted 07 Mar in reply to Danail Vasilev Link to this post

    Thank you,Danail

    Your solution seems work. But if we make our own Tooltip by RadToolTip, it will looks different to the original chart series tooptip. And the position and color of different series are various, so are the tooptip's. Since we will use database driven chart, it will be very complicated to sync the series tooltip dynamically by RadToolTip. Is there any way to show and hide the series tooltips by code?

    Thanks

     

  6. Answer
    Danail Vasilev
    Admin
    Danail Vasilev avatar
    1492 posts

    Posted 10 Mar Link to this post

    Hi Brad,

    It is not possible to show/hide the tooltips explicitly. You can try to disable the native tooltips displaying and use a RadToolTip instead. For example:

            <script type="text/javascript">
                function seriesHover(e) {
                    e.preventDefault();
                    alert(e.value);
                }
            </script>
            <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Width="600px" Height="400px">
                <ClientEvents OnSeriesHover="seriesHover" />
    ...

    Where the alert() method can be replaced with the RadToolTip control.

    Regards,
    Danail Vasilev
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  7. Brad
    Brad  avatar
    3 posts
    Member since:
    Mar 2014

    Posted 10 Mar in reply to Danail Vasilev Link to this post

    Thank you,Danail

    I think that's it. We will do the customized tooltips by RadToolTip control.

     

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017