ClientSeriesClicked Event in Q2 2012 SP1

8 posts, 0 answers
  1. Roy Gelerman
    Roy Gelerman avatar
    12 posts
    Member since:
    Jul 2006

    Posted 24 Jul 2012 Link to this post


    Hello

    The click event seems to not be as useful as it could be because it does not allow for a "hidden data field".  For example, suppose I have a bar chart showing billionaires by net worth.  Name on the axis, the bar value is net worth.  If I do an Ajax callback or a popup window to another URL in the click event, I need to lookup the billionaire based on their name on the server- which could be tricky if there are billionaires with the same name, so perhaps I then lookup on a combination of net worth and name, which is still an imprecise solution.   Think of the imprecision of passing javascript numbers and persons/family names  (containing spaces, periods or ampersands) as URL parameters to do a lookup.  I would much prefer to have a hidden bound field say HiddenDataField="BillionaireID" in the BarSeries element that I can access in the javascript arguments.  Then I can lookup the correct individual precisely

    i.e.

    <telerik:BarSeries DataField="NetWorth" HiddenDataField="BillionaireID"/>
    <XAxis DataLabelsField="FullName" >

    a simple redirect based on the click would roughly be

     

    function RadHtmlChart1_SeriesClicked(sender,args)

    {
        window.location="billionaire.aspx?id=" + args._hidden;

    }


    Please let me know if I am missing something that would make the above easier to implement
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 26 Jul 2012 Link to this post

    Hi Roy,

    If I understand you correctly you would like to have one hidden value for the entire series. Is this correct or are you referring to an arbitrary value for each series item? I am asking this to get the concept clearer in order to see how / if it can be integrated in the context of a data visualization control like the RadHtmlChart.

    The RadToolTipManager has similar functionality - each target control can have an arbitrary string assosiated in order to facilitate the server data load (you can see it in action in this demo, for example). Is this concept similar to what you want to achieve?


    All the best,
    Marin Bratanov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Roy Gelerman
    Roy Gelerman avatar
    12 posts
    Member since:
    Jul 2006

    Posted 07 Sep 2012 Link to this post


    Hello Marin,

    Sorry for the long delay, but yes a string ID would work fine as that can handle numbers, GUIDs or strings.  To clarify, if I had a simple database table like this (data from forbes.com)

    BillionaireID Name     NetWorth
    ------------- ----     -----
    21  Carlos Slim Helu & family  69.0
    32  Bill Gates    61.0
    221  Christy Walton & family   25.3
    189  Prince Alwaleed Bin Talal Alsaud 18.0

    If I want to go to page with a biography when the user clicks on the "Carlos Slim Helu & family" bar, I'd have to hope the name is unique and possibly deal with URL escaping etc (the ampersand in the name in this case).  I'd much rather have the row ID as a 'hidden' field that is passed in to the client side click event and then use the 21 as the parameter I pass to another URL. 

    function RadHtmlChart1_SeriesClicked(sender,args)

    {
         window.location="biography.aspx?id=" + args._hidden; //  biography.aspx?id=21

    }
  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 11 Sep 2012 Link to this post

    Hi Roy,

    I am sorry to say that currently such a field is not in our immediate plans, yet I have logged the concept in our internal database and we will consider its impact. We will probably expose the dataItem for the clicked series item in the event so that you will be able to access all columns from the datasource you have given the chart. I am not able to provide any time estimate on this, however, because the tasks for the Q3 2012 release have already been set and planned.


    Kind regards,
    Marin Bratanov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. David Moore
    David Moore avatar
    23 posts
    Member since:
    Jul 2008

    Posted 21 Jan 2014 Link to this post

    Has anything new happened on this?  This seems like pretty basic functionality that should be included with something like this.  I would hate to have go back to google charts.
  7. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 23 Jan 2014 Link to this post

    Hi David,

    The dataItem object has already been exposed by the HtmlChart, so that additional fields from the data source can be accessed either from the eventArgs of the clicked/hovered series or through the template of labels/tooltips.

    Such an examples can be found in OnClientSeriesClicked and ClientTemplate for Series Labels and Tooltips help articles.

    Regards,
    Danail Vasilev
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  8. Anil
    Anil avatar
    8 posts
    Member since:
    Jun 2013

    Posted 23 Dec 2015 Link to this post

    I am in similar situation.

    I have Project name and ProjectID. I use stacked column chart with 3 series.

    When I click on series 1 in column stack of proejct1, I need to pass ProjectID instead of name to server side.

    I checked dataitem, but I could not get anything from there.

    Any help is appreciated.

    Thanks,

    Anil

  9. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 25 Dec 2015 Link to this post

    Hi,

    I have attached a sample where similar scenario is implemented.

    Hope this will help you solve the issue.

    Regards,
    Plamen
    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017