ClientTemplate in Tooltip

2 posts, 0 answers
  1. MBEN
    MBEN avatar
    159 posts
    Member since:
    Nov 2011

    Posted 20 Oct 2015 Link to this post



    I am trying to show a currency value in the tooltip for my bar chart.

    I am using the below code in code-behind to set the format but the number isn't displayed as currency.

    It used to work but I recently upgraded to the latest version of Telerik and it stopped working. Please let me know if there's anything that needs to be changed.

    string template = "#=kendo.format(\\\'{0:c}\\\', dataItem.yValue)#";
    string tooltipTemplate = "#= dataItem.xValue# (#=kendo.format(\\\'{0:C2}\\\', dataItem.yValue)#)";       
    barSeries.LabelsAppearance.ClientTemplate = template;
    barSeries.TooltipsAppearance.ClientTemplate = tooltipTemplate;
    barSeries.LabelsAppearance.Position = Telerik.Web.UI.HtmlChart.BarColumnLabelsPosition.OutsideEnd;

  2. Danail Vasilev
    Danail Vasilev avatar
    1476 posts

    Posted 21 Oct 2015 Link to this post


    You should use two backslashes to escape the quotes from the code behind - I see that you are using three backslashes.

    If the above step, however, do not help it would be better to reproduce the issue in a runnable sample and then provide it back to us for further investigation.

    Danail Vasilev
    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. DevCraft R3 2016 release webinar banner
Back to Top