showing line chart vertical axis in another number language

白昼怎懂夜的黑 提交于 2019-12-11 12:56:34

问题


i am trying to make vertical axis labeled in indian ١،٢،٣ and plotted in Indian too , however it seems it has no meaning for computer , since there is no native encoding for arabic number , however in terms of english 0,1,2,3... you can do calculations no problem in that , the problem i must to show indian-arabic values

this line chart is done by google Visualization api , the last version 46.0 , and the lang is ar however the result is not as i aimed for , the vaxis should be in ١،٢،٣ and the plotted values


回答1:


(This is a slightly modified answer to the duplicate question posted at stackoverflow.com/questions/46423807. Martijn Pieters, if you are paying attention, please delete that question instead of this one.)

There is a solution, but you'll have to use an undocumented feature, which will be documented at some point. You'll need to make this call sometime before you draw your chart.

google.visualization.NumberFormat.useNativeCharactersIfAvailable(true);

This works with material charts prior to v46, and also in classic charts starting with v46. See this example: https://jsfiddle.net/dlaliberte/6k8vdgz7/

You may see some problems depending on what formatting options you also specify.



来源:https://stackoverflow.com/questions/46449241/showing-line-chart-vertical-axis-in-another-number-language

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!