I want to show a small popup at the point where user clicks on the graph.I have read the answer given for the question
Showing popup on clicking a point in graph AChartEngine
it suggests toast as the answer but I want user to select between two options in the popup.I tried using of alertdialog and even created a custom dialog but they cover the whole screen area whereas I want just a small popup at the place where user clicks on the graph.
Here is my onotuch listener where I get the x,y coordinate
mChart.setOnTouchListener(new OnTouchListener() {
if(event.getAction() == MotionEvent.ACTION_UP)
{
int xd= (int) event.getX();
int yd = (int) event.getY();
}
The code for repositioning the dialog
AlertDialog alertDialog = builder.create();
alertDialog.show();
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
lp.x= xd;
lp.y= yd;
alertDialog.getWindow().setAttributes(lp);