echarts-python icon indicating copy to clipboard operation
echarts-python copied to clipboard

中文乱码

Open freetest opened this issue 9 years ago • 7 comments

你好。 请问一下中文乱码需要怎么处理了?

luanma

title

freetest avatar Dec 02 '16 10:12 freetest

补充

freetest avatar Dec 02 '16 10:12 freetest

抱歉这三个月比较忙碌,才抽出空来维护这个项目。

Python 中大家习惯约定使用 Unicode 来交换中文字符,只需:

chart = Echart(u'中文', u'The data is fake 中文')

即可

yufeiminds avatar Dec 22 '16 15:12 yufeiminds

我试过在前面加u了,但是直接显示空白。

'title': {'text': u'\u4f60\u597d', 'subtext': 'The data is fakt'}};

freetest avatar Dec 23 '16 05:12 freetest

''' def echart(request):

chart = Echart(u"你好", "The data is fakt")

chart.use(Bar("Tyloo", ["50", "72", "64", "42", "30", "72"], ))
chart.use(Bar("VG", ["55", "48", "56", "63", "70", "55"]))
chart.use(Axis("category", "bottom", "map", ["de_dust2", "de_cache", "de_mirage", "中文", "de_nuke", "de_cbble"]))
chart.use(Legend(["Tyloo", "VG"], position=('center', "bottom")))
options = chart.json

return render(request,'test/c.html',locals())

'''

freetest avatar Dec 23 '16 05:12 freetest

有可能是 Axis 的问题,更新下最新的版本试试

yufeiminds avatar Dec 25 '16 10:12 yufeiminds

你解决了吗?是版本的问题吗?

weixiaohhh avatar Jun 30 '17 14:06 weixiaohhh

我换成python3 解决的。

weixiaohhh avatar Jun 30 '17 14:06 weixiaohhh