This is a migrated thread and some comments may be shown as answers.
Chart Localisation
8 Answers 19 Views
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 14 Aug 2014, 01:48 PM
I have some charts in a master page site which display data in currency (£) terms.

The localisation quick fix  http://www.telerik.com/help/aspnet-ajax/htmlchart-accessibility-and-internationalization-localization.html  works fine, but in my master page site it fails and the default $ is displayed.

Does anybody know why a master page site messes this up?

8 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 15 Aug 2014, 06:56 AM
Hi Ed,

I have already replied to the support ticket that was opened by on the matter and I paste my answer below, so that the rest of the forum members can benefit of it.

Placing the script reference and kendo culture change code in the master page works properly for charts in the master page as well as charts in the content page on my side. Can you try the attached VS example and then tell me whether it works as expected?


Regards,
Danail Vasilev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Philipp
Top achievements
Rank 1
answered on 11 Dec 2015, 11:04 AM

Hi,

 i have a lot of problems with the HTMLChart and the localization stuff. After a few hours of reading topics and forum-posts i still can't get it to work correct.

I have 2 MasterPage-Files. MainPage.master for all main-views, and EditPage.master for all edit Frames (RadWindow-Contents)

I have the same script-setup in those files (see picture 01, 02).

In EditPage everything works as excpected but in MainPage it always chrashes saying "the Object doesnt support the Property or Method 'culture' "

Picture 03 shows how the resources are loaded.

Picture 04 shows how the Object -kendo- looks like in MainPage.Master.

What happens here? Any help appreciated.

 

0
Danail Vasilev
Telerik team
answered on 12 Dec 2015, 10:54 AM
Hello Philipp,

It looks like the kendo object is not initialized yet for some reason. I would suggest that you open a support ticket (requires a subscription) where you can attach a runnable sample that reproduces the issue, so that I can investigate it further.

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
0
Philipp
Top achievements
Rank 1
answered on 14 Dec 2015, 02:51 PM

Hi Danail,

it felt like i messed something up so i removed every single bit and restarted it along with your descritptions about localization.

Right now i have the initialization of the kendo-object right and the resourcefile is loaded correctly. Never the less everything stayed in english, although i inspected the kendo-object at runtime and saw that cultures.current was 'de-DE'. Very strange. 

I copied one of your demo chasrts to see if it fails the same way, but it didn't. Again i thought - very strange.

Finally i realised what the problem was. I used ClientTemplates for the LabelsAppearance like this:

 

<LabelsAppearance DataFormatString="N1">
    <ClientTemplate>
        #if(value > 0){# #=value# #}#
    </ClientTemplate>
</LabelsAppearance>

This doesn't work with localization on my end. When i remove the clientTemplate-block everything works as expected, with clientTemplate all stays english. Am i missing something here or do a mistake?

Thanks for your support

0
Marin Bratanov
Telerik team
answered on 15 Dec 2015, 12:24 PM

Hello Phillip,

You can do this via the kendo.format() method:

Here is a basic example:

<LabelsAppearance>
    <ClientTemplate>
        #if(value > 0){# #= kendo.format(\'{0:C1}\', value)# #}#
    </ClientTemplate>
</LabelsAppearance>

Regards,

Marin Bratanov
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
0
Philipp
Top achievements
Rank 1
answered on 16 Dec 2015, 08:46 AM

Hello Marin,

perfect! Everything fine now. Thank you all for your great support (as always).
Right now i really enjoy the htmlChart-Control as a excellent visualisation tool.
Also the clientExportManager is a nice addition to the the controls (i thought of doing this by myself a year ago but had no time ^^).

Best regards,

Philipp

0
Lucy
Top achievements
Rank 1
answered on 15 Jan 2019, 12:02 AM

How to format the yaxis label based on the culture? The following code always renders the yaxis in EN format instead of FR, when the user loaded in FR mode. Y axis will be having amount value.

<script src="js/kendo.all.min.js"></script>

<script src="js/kendo.culture.en-CA.min.js"></script>

<script src="js/kendo.culture.fr-CA.min.js"></script>

 

kendo.culture("<%=GetCultureString()%>");

 

<PlotArea>

<YAxis>

<LabelsAppearance DataFormatString="C" />

</YAxis>

 

I tried this as well, but didnt work

 

 <YAxis>                                         <LabelsAppearance>     <ClientTemplate>         #if(value > 0){# #= kendo.format(\'{0:C1}\', value)# #}#     </ClientTemplate></LabelsAppearance>

0
Marin Bratanov
Telerik team
answered on 17 Jan 2019, 01:27 PM
Hello Lucy,

Let's keep this in your own thread on this where you already have my answer: https://www.telerik.com/forums/chart-localization-f01f5663f4d3.


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Asked by
Ed
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Philipp
Top achievements
Rank 1
Marin Bratanov
Telerik team
Lucy
Top achievements
Rank 1
Share this question
or