以另一种数字语言显示折线图垂直轴 [英] showing line chart vertical axis in another number language
问题描述
i我试图在印度1,2,3上标注垂直轴并在印度标绘,但它似乎对计算机没有任何意义,因为没有阿拉伯数字的本地编码,但是就条形码而言英语0,1,2,3 ...你可以做计算没有问题,在这个问题上,我必须显示印度 - 阿拉伯语价值
这个折线图是由Google Visualization API完成的,最后一个版本是46.0,lang是ar然而结果不是我的目标,vaxis应该在1,2,3和绘图值
解决方案
(这是一个稍微修改的答案,在stackoverflow.com/questions/46423807发布的重复问题。Martijn Pieters,如果你正在关注,请删除这个问题,而不是这个o ne。)
有一个解决方案,但是你必须使用一个未记录的特性,这个特性在某些时候会被记录下来。您需要在绘制图表之前的某个时间进行调用。
google.visualization.NumberFormat.useNativeCharactersIfAvailable(true);
这适用于v46之前的材质图表,也适用于以v46开头的经典图表。看到这个例子: https://jsfiddle.net/dlaliberte/6k8vdgz7/
您可能会看到一些问题,具体取决于您指定的格式选项。
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
(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.
这篇关于以另一种数字语言显示折线图垂直轴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!