javascript – amCharts – 我如何使用非英语日历

前端之家收集整理的这篇文章主要介绍了javascript – amCharts – 我如何使用非英语日历前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
有没有办法在amcharts trendline中使用波斯语或阿拉伯语日历?
月份名称没用,因为与其他日历有冲突,

AmCharts Live Editor

解决方法

我建议你在amChart目录下的Lang文件夹中创建名为fa.js的JavaScript文件,代码如下.
AmCharts.translations.fa = {
"monthNames": ["دی","بهمن","اسفند","فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذز"],"shortMonthNames":  ["دی","dayNames": ["یکشنبه","دوشنبه","سه شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],"shortDayNames": ["یکشنبه","zoomOutText": "نمایش همه"}

现在你需要做更多的事情:

将fa.js导入您的项目

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

然后在amchart对象中定义它

var chart = AmCharts.makeChart("chartdiv",{
    "type": "serial","theme": "dark","marginRight": 40,"marginLeft": 40,"language":"fa"
    .
    .
    .
原文链接:https://www.f2er.com/js/157428.html

猜你在找的JavaScript相关文章