Set an horizontal scroll to my Barchart in swift

孤人 提交于 2019-12-10 23:09:24

问题


I am using the Charts framework from Daniel Cohen Gindi which is great but:

I would like my barchart to scroll horizontally to see additional data.

I've tried to add a scroll view but it didn't worked. I also tried different value like

barChart.setVisibleXRangeMaximum(10)
barChart.moveViewToX(90)

but it didn't work.

Is anyone managed it ?

Fingers crossed


回答1:


the scroll will only happen if you zoomed in. By default, all data are plotted on the canvas, so nothing to scroll.

You can try increase scaleX by code, to see if your code works.




回答2:


First set bar chart data and then call 'barChart.setVisibleXRangeMaximum(10)'



来源:https://stackoverflow.com/questions/36884745/set-an-horizontal-scroll-to-my-barchart-in-swift

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!