iOS Charts zoom property

2019-08-23 00:12发布

I am using iOS charts library and in my application there could be lots of x axis values for my bar chart view but, I need to show few of them. I have tried to do it with barChartView.setVisibleXRangeMaximum(12) though it is causing some weird issues. (Like Bar chart's bar fill all x-axis) Instead of using that function I am trying to use zoom property barChartView.zoom(scaleX: 4, scaleY: 0, x: 0, y: 0) . However, I am not sure how many x axis values come when I draw the chart. In some cases, it's 60,84 or 800. How can I calculate right zoom ratio to accomplish for showing 10-12(any number between them enough for me) x-Axis values?

1条回答
Rolldiameter
2楼-- · 2019-08-23 01:17

You might want to use:

barChartView.setVisibleXRange(minXRange: 10.0, maxXRange: 12.0)

instead of:

barChartView.setVisibleXRangeMaximum(12.0)
查看更多
登录 后发表回答