Open freetest opened 7 years ago
补充
抱歉这三个月比较忙碌,才抽出空来维护这个项目。
Python 中大家习惯约定使用 Unicode 来交换中文字符,只需:
chart = Echart(u'中文', u'The data is fake 中文')
即可
我试过在前面加u了,但是直接显示空白。
'title': {'text': u'\u4f60\u597d', 'subtext': 'The data is fakt'}};
''' 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())
'''
有可能是 Axis 的问题,更新下最新的版本试试
你解决了吗?是版本的问题吗?
我换成python3 解决的。
你好。 请问一下中文乱码需要怎么处理了?