如何将x轴文字设置成垂直显示
![img](https://img-mid.csdnimg.cn/release/static/image/mid/ask/699223971966148.png?x-oss-process=image/auto-orient,1/resize,w_320,m_lfit)
代码如下
c = (
Bar(init_opts=opts.InitOpts(theme=ThemeType.LIGHT))
.add_xaxis(name[::-1])
.add_yaxis(str(loca) + '行业板块资金', vol[::-1],
itemstyle_opts=opts.ItemStyleOpts(color=JsCode(color_function)))
.set_series_opts(
label_opts=opts.LabelOpts(
position='right',
formatter=JsCode("function(params){return params.value + '%'}"),
is_show=False
)
)
.set_global_opts(title_opts=opts.TitleOpts(title='', ),
yaxis_opts=opts.AxisOpts(name='(亿)'),
xaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(interval=2,
rotate=-90
)
)
)
.render('E:/自动化办公/盘后数据/pic/test.html')
有查资料说可以用如下代码实现,但是设置时总是提示return在函数外
formatter = function(value){
return value.split("").join("\n")