liangfu / achartengine

Automatically exported from code.google.com/p/achartengine
0 stars 0 forks source link

Fix OnTouchEvent for GraphicalView #292

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. setOnTouchListener() to a View.OnTouchListener implementation
2. Inside the OnTouchListener implementation, get a SeriesSelection by calling 
GraphicalView.getCurrentSeriesAndPoint()
3. The SeriesSelection returned is always null

What is the expected output? What do you see instead?

The SeriesSelection returned should not be null but should work like it would 
if it was in an OnClickEvent. Apparently ACE uses OnTouchEvent internally which 
causes a problem for calling client code.

chart.setOnTouchListener(new View.OnTouchListener()
{
    @Override
    public boolean onTouch(View v, MotionEvent event)
    {
        SeriesSelection seriesSelection = chart.getCurrentSeriesAndPoint();

        if(seriesSelection == null)
        {
            Log.d(TAG, ":(");
        }

        return true;
    }
});

What version of the product binary library are you using?

1.0.0

Original issue reported on code.google.com by jonathon@awnry.com on 27 Mar 2013 at 12:38

GoogleCodeExporter commented 9 years ago
Have you tried version 1.1.0?
https://repository-achartengine.forge.cloudbees.com/snapshot/org/achartengine/ac
hartengine/1.1.0/

Original comment by dandrome...@gmail.com on 3 Apr 2013 at 3:48

GoogleCodeExporter commented 9 years ago
Use setOnClickListener. See an example here: 
http://code.google.com/p/achartengine/source/browse/trunk/achartengine/demo/org/
achartengine/chartdemo/demo/chart/XYChartBuilder.java

Original comment by dandrome...@gmail.com on 3 Apr 2013 at 3:56