How to show grid for a custom x axis label: achartengine

风格不统一 提交于 2019-12-24 03:20:43

问题


I want a functionality where if user clicks on the the graph and if the x co ordinate is close to our point on XY line graph then I want to show a vertical grid for that point.

The only function that seems related is mRenderer.setShowCustomTextGridY(boolean showGrid)

But for which value should the grid be shown is not clear in the documentation.

Please help. Which function should I use?


回答1:


Once you have the X axis value, you can add a custom text label this way:

renderer.addXTextLabel(x, "label");

Then, if you call a mChartView.repaint(), the custom text grid will be displayed.




回答2:


You need to use:

renderer.setShowCustomTextGrid(true);


来源:https://stackoverflow.com/questions/22344743/how-to-show-grid-for-a-custom-x-axis-label-achartengine

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