Achart引擎折线图 - 显示上弹出点点击 [英] Achart Engine Line chart - Display pop up on click of point

查看:235
本文介绍了Achart引擎折线图 - 显示上弹出点点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Achart引擎折线图来显示值,我使用点式的圆。

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

我想实现如下:

1)增加点式的宽度 - 我的意思是圈应该是有点大了

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

2)我想显示在最重要的是,这将显示的X和Y的值弹出每个点的点击。

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.

我发现这个code,但如何显示其值小的弹出?

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]
     }
  }
});

它可能已经没有在SDK中给出,但仍,如果任何人试图将此作为成功。

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

**编辑**

链接1:<一href=\"http://stackoverflow.com/questions/17721044/achartengine-toscreenpointdouble-always-returns-nullpointerexception?rq=1\">achartengine toScreenPoint(双)总是返回NullPointerException异常

在图像你可以看到一个弹出我想要实现这样的。

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

推荐答案

您可以看到一个例子<一个href=\"https://$c$c.google.com/p/achartengine/source/browse/trunk/achartengine/demo/org/achartengine/chartdemo/demo/chart/XYChartBuilder.java\"相对=nofollow>此处如何在图表中显示单击点,使用AChartEngine上。

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

这篇关于Achart引擎折线图 - 显示上弹出点点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆