Localization in Chart Title and Legend title RADHTML chart

2 posts, 0 answers
  1. Uttam Dhakal
    Uttam Dhakal avatar
    29 posts
    Member since:
    Jan 2010

    Posted 08 Jan 2013 Link to this post

    Hi I have a pie chart that has been created programatically.
    I am trying to add localization here.
    This is part of my SharePoint visual web part.
    I have included the resource files for different languages.
    follwoing is my code
    totalallowedspace = getLocalizedValue("TotalSpaceAllotted", LCID);
    i am getting the local value for the string from the resource file

    PieChart.ChartTitle.Text = totalallowedspace+" "+ alloweddspace.ToString() + " " + "GB";
    i am adding the string to the title with some value that is calculated from other methods.

    This works perfectly for english but when i browse in French there is no Chart Visible.
    It does not displays the chart.

    How do i enable localization for the pie chart.

    Please guide me through both ways from code behind and from UI side.
    I have seen there are few resources for UI side but not for code behind.
    Please Help
  2. Danail Vasilev
    Danail Vasilev avatar
    1476 posts

    Posted 11 Jan 2013 Link to this post


    It is possible that the French localization adds some apostrophes to your string which is breaking the rendering of the chart itself (or more precisely - the JavaScript strings that are used). For example:
    <ChartTitle Text="This is sampe chart's title">
    will break the chart, so that the apostrophe should be escaped by a backslash:
    <ChartTitle Text="This is sampe chart\'s title">
    and in the code-behind you would need two:
    PieChart.ChartTitle.Text = "This is sampe chart\\'s title"

    Please refer to the following help article where described different scenarios and cases of handling special symbols are described.

    If, however, you are not able to fix your issue after applying the information from the article, I advise that you send us a runnable project, so we can track it locally. To make things simpler a basic snippet of a chart with a few items with an example string that breaks it will suffice.

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