I want to show a small popup at the point where the user clicks on the chart. I read the answer asked for the question
Displaying a pop-up window when you click a point in the AChartEngine chart
it offers a toast as an answer, but I want the user to choose between two parameters in popup. I tried using alertdialog and even created a user dialog, but they cover the entire area of the screen, while I want only a small pop-up window in the place where user clicks on a 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();
}
Code for repositioning a dialog box
AlertDialog alertDialog = builder.create();
alertDialog.show();
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
lp.x= xd;
lp.y= yd;
alertDialog.getWindow().setAttributes(lp);