@Override public ArrayList<ArrayList<Region>> defineRegions(ArrayList<ChartSet> data){
  ArrayList<ArrayList<Region>> result=new ArrayList<ArrayList<Region>>();
  ArrayList<Region> regionSet;
  float x;
  float y;
  for (  ChartSet set : data) {
    regionSet=new ArrayList<Region>(set.size());
    for (    ChartEntry e : set.getEntries()) {
      x=e.getX();
      y=e.getY();
      regionSet.add(new Region((int)(x - sRegionRadius),(int)(y - sRegionRadius),(int)(x + sRegionRadius),(int)(y + sRegionRadius)));
    }
    result.add(regionSet);
  }
  return result;
}

@ Override public ArrayList < ArrayList < Region > > defineRegions ( ArrayList < ChartSet > data ) { ArrayList < ArrayList < Region > > result = new ArrayList < ArrayList < Region > > ( ) ; ArrayList < Region > regionSet ; float x ; float y ; for ( ChartSet set : data ) { regionSet = new ArrayList < Region > ( set . size ( ) ) ; for ( ChartEntry e : set . getEntries ( ) ) { x = e . getX ( ) ; y = e . getY ( ) ; regionSet . add ( new Region ( ( int ) ( x - sRegionRadius ) , ( int ) ( y - sRegionRadius ) , ( int ) ( x + sRegionRadius ) , ( int ) ( y + sRegionRadius ) ) ) ; } result . add ( regionSet ) ; } return result ; }
( optional ) to be overridden in order for each chart to define its own clickable regions . this way , classes extending chartview will only define their clickable regions . important : the returned vector must match the order of the data passed by the user . this ensures that ontouchevent will return the correct index .
