AmCharts - How Can I Use a Non-English Calendar

Is there a way to use the Persian or Arabic calendar in amcharts trends?
monthly names are not useful because they conflict with other calendars,

AmCharts Live Editor !

+7
javascript calendar amcharts
source share
3 answers

I recommend that you create a JavaScript file called fa.js with the code below in the Lang folder, which is available in the amChart directory.

AmCharts.translations.fa = { "monthNames": ["دی", "بهمن", "اسفند", "فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذز"], "shortMonthNames": ["دی", "بهمن", "اسفند", "فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذز"], "dayNames": ["یکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"], "shortDayNames": ["یکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"], "zoomOutText": "نمایش همه"} 

Now you need to do a couple of things more:

Import fa.js into your project

 <script type="text/javascript" src="/amcharts/lang/fa.js"></script> 

Then define it in the amchart object

  var chart = AmCharts.makeChart("chartdiv", { "type": "serial", "theme": "dark", "marginRight": 40, "marginLeft": 40, "language":"fa" . . . 
+1
source share

Unfortunately, you need to restore the entire (Persian Solar) calendar using amCharts methods for formatting or parsing dates

You can find information about formatting dates on

amCharts Base Validation - Date Formatting

if you can do it feel free to share it with us

+1
source share

you can use date objects to place your trend lines, unfortunately, the live editor only accepts valid JSON, so you may need to use the date strings "2013-12-03".

 "trendLines": [{ "finalDate": new Date(2014,11,3), "finalValue": 5, "initialDate": new Date(2014,11,1), "initialValue": 5, }], 
0
source share

All Articles