This is a migrated thread and some comments may be shown as answers.

Localization in Chart Title and Legend title RADHTML chart

1 Answer 43 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Uttam Dhakal
Top achievements
Rank 1
Uttam Dhakal asked on 08 Jan 2013, 07:48 PM
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

1 Answer, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 11 Jan 2013, 08:27 AM
Hello,

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.
Tags
Chart (HTML5)
Asked by
Uttam Dhakal
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Share this question
or