Achart Engine Line Chart - Display at the click of a dot

I use the Achart engine chart diagram to display values; I use CIRCLE point style.

I am trying to implement below:

1) Increase the width of the point style - I mean that the circle should be larger.

2) When each point is clicked, I want the popup to appear on top of the one that displays the X and Y values.

I did some research on this, but could not find a solution.

I found this code, but how to display a 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 may not have been listed in the SDK, but still, if someone tried this, it was successful.

** EDIT **

Link 1: achartengine toScreenPoint (double) always returns nullPointerException

In the image, you can see a popup that I want to implement this way.

+1
source share
1 answer

Here you can see an example on how to display a clicked point in your chart using AChartEngine.

+1
source

Source: https://habr.com/ru/post/1440468/


All Articles