这是我的询问(编辑):
我尝试使用图表绘制月度图形,但是我将这些月份的名称放在X轴上会遇到一些困难。我的默认值如下图所示:default value
因此,在投入了几个小时无用的结果后,我想问你是否知道如何获得类似于this one的情节。总结一下:
提前致谢。如果您需要我的一些代码,我可以与您分享。
亲切的问候。
在玩完并进行更好的研究之后,这就是我的问题的答案:
//Give the value of the months to the x axis
barChart.xAxis.valueFormatter = IndexAxisValueFormatter(values:months)
barChart.xAxis.granularity = 1
//Position of the x axis, rotation of the labels on the x axis and show all the names of the months consecutively
barChart.xAxis.labelPosition = XAxis.LabelPosition.bottom
barChart.xAxis.labelRotationAngle = -90.0
barChart.xAxis.setLabelCount(counter, force: false)