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

2019-07-17 02:33发布

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?

2条回答
兄弟一词,经得起流年.
2楼-- · 2019-07-17 02:58

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.

查看更多
相关推荐>>
3楼-- · 2019-07-17 03:04

You need to use:

renderer.setShowCustomTextGrid(true);
查看更多
登录 后发表回答