AndroidPlot - Make graph scrollable along with x-axis labels

£可爱£侵袭症+ 提交于 2019-12-10 21:34:54

问题


I created a line graph with AndroidPlot.
Since I have got pleanty of Domain values(x-axis labels), I need to implement a scroll.
With this example given http://androidplot.com/docs/how-to-pan-zoom-and-scale/ , the graph scrolls, but the x-axis labels changes dynamically according to the scroll.
But I just need the entire x-axis values to get scrolled along with the graph.
Is this possible with HorizontalScrollview or any other help is appreciated....


回答1:


The gridlines are calculated and drawn in relation to the origin. By default the origin is always the left most visible value, which obviously changes when scrolling. To have a grid locked to specific values set a user defined origin:

setUserDomainOrigin()    and    setUserRangeOrigin()

now the grid and it's values will be calculated and drawn in relation to this User chosen origin and scroll along with the fixed origin.



来源:https://stackoverflow.com/questions/29207408/androidplot-make-graph-scrollable-along-with-x-axis-labels

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