Showing popup on clicking a point in graph AChartEngine

落爺英雄遲暮 提交于 2020-01-05 10:10:25

问题


I want to show a little popup containing the information of the point clicked in a graph which uses AchartEngine for drawing graphs. I am currently showing the point information in a toast but the requirement is to show it near the point in the graph. Is there any such feature in the API or any suggestions how I can accomplish this task ? Thanks in advance.


回答1:


The toast sounds like a good way to display information. Toast takes the x and y co-ordinate for it's placement which is kinda neat and what you need. The x/y co-ords are in pixels units in relation to the your screen's width/height px dimens.

You don't need a dialog popup, i believe. Unless you really need user confirmations like OK/Done or Cancel/Dismiss action buttons.

You can also look at fragments to use for your needs.

But i think toast is ideal for your needs. Your choice.



来源:https://stackoverflow.com/questions/20462122/showing-popup-on-clicking-a-point-in-graph-achartengine

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