1

I am using Achart Engine Line chart to display values, i am using point style CIRCLE.

I am trying to implementing the below :

1) Increase the point style width - i mean the circle should be bit bigger.

2) On click of each point i want a popup to be displayed on top of that which will display the values of X and Y.

I have done some research on this but was not able to find the solution.

I found this code but how to display the small popup with values ?

final LineChart chart = new LineChart(buildDataset(mTitles, data), mRenderer);
final GraphicalView view = new GraphicalView(mContext, chart);
view.setOnClickListener(new View.OnClickListener() {
  public void onClick(View v) {
     double[] xy = chart.toScreenPoint(view.toRealPoint(0));
     int[] location = new int[] {(int) xy[0], (int) xy[1]};
     SeriesSelection seriesSelection = view.getCurrentSeriesAndPoint();
     if (seriesSelection != null) {
         final Data d = mModel.getDiaryAt(seriesSelection.getSeriesIndex(), 
         seriesSelection.getPointIndex());
         //show popup at xy[0] xy[1]
     }
  }
});

It might have been not given in the SDK but still if anyone has tried this as was successful.

** EDIT **

Link 1 : achartengine toScreenPoint(double) always returns nullPointerException

In the image you can see a popup i want to implement like that.

Community
  • 1
  • 1
user2056563
  • 600
  • 2
  • 12
  • 37

1 Answers1

1

You can see an example here on how to display the clicked point in your chart, using AChartEngine.

Dan D.
  • 32,246
  • 5
  • 63
  • 79
  • thanks, i have seen this and i am able to show the clicked point via Toast, but can you please suggest me or point me where we can display a custom popup when we click on the point ? – user2056563 Oct 20 '14 at 10:29
  • Take a look at line 167, that's what it does. – Dan D. Oct 20 '14 at 10:34