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

    Hi,

     

    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
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 21 Oct 2015 Link to this post

    Hello,

    You should use two backslashes to escape the quotes from the code behind - http://docs.telerik.com/devtools/aspnet-ajax/controls/htmlchart/troubleshooting/handle-special-symbols. 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.

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