Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X轴 文字竖直显示可以弄吗 #383

Closed
DogTwoChen opened this issue Aug 10, 2018 · 2 comments
Closed

X轴 文字竖直显示可以弄吗 #383

DogTwoChen opened this issue Aug 10, 2018 · 2 comments

Comments

@DogTwoChen
Copy link

2018-08-10 10 19 20

我只能找到旋转的方法,但旋转之后效果不是很好

2018-08-10 10 25 52

@AAChartModel
Copy link
Owner

https://api.hcharts.cn/highcharts#xAxis.labels

上面的链接内容是 Highcharts 对于 X轴的 label 的所有设置选项,里面没有找到可以直接设置图表的 X轴文字 label 垂直显示的属性.

@AAChartModel
Copy link
Owner

AAChartModel commented Aug 10, 2018

但是好在 Highcharts 支持 HTML 格式文本渲染,所以可以间接地实现这个需求

如下配置 AAChartModel 的categories数组元素即可

     AAChartModel *aaChartModel= AAObject(AAChartModel)
    .chartTypeSet(AAChartTypeColumn)
    .titleSet(@"X轴文字垂直显示")
    .subtitleSet(@"")
    .categoriesSet(@[@"孤<br>岛<br>危<br>机",
                     @"使<br>命<br>召<br>唤",
                     @"荣<br>誉<br>勋<br>章",
                     @"狙<br>击<br>精<br>英",
                     @"神<br>秘<br>海<br>域",
                     @"最<br>后<br>生<br>还<br>者",
                     @"巫<br>师<br>3<br>狂<br>猎",
                     @"对<br>马<br>之<br>魂",
                     @"蝙<br>蝠<br>侠<br>之<br>阿<br>甘<br>骑<br>士",
                     @"地<br>狱<br>边<br>境",
                     @"闪<br>客",
                     @"忍<br>者<br>之<br>印"])
    .yAxisTitleSet(@"")
    .tooltipEnabledSet(false)
    .seriesSet(@[
                 AAObject(AASeriesElement)
                 .nameSet(@"2017")
                 .dataSet(@[@45,@88,@49,@43,@65,@56,@47,@28,@49,@44,@89,@55])
                 .allowPointSelectSet(YES)
                 ,
                 ]
               );

这里的 HTML 换行标签<br> 需要你自己插入

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants