org.achartengine.chart
Class PieMapper

java.lang.Object
  extended by org.achartengine.chart.PieMapper
All Implemented Interfaces:
java.io.Serializable

public class PieMapper
extends java.lang.Object
implements java.io.Serializable

PieChart Segment Selection Management.

See Also:
Serialized Form

Constructor Summary
PieMapper()
           
 
Method Summary
 void addPieSegment(int dataIndex, float value, float startAngle, float angle)
          Add configuration for a PieChart Segment
 boolean areAllSegmentPresent(int datasetSize)
          If we have all PieChart Config then there is no point in reloading it
 void clearPieSegments()
          Clears the pie segments list.
 double getAngle(Point screenPoint)
          Fetches angle relative to pie chart center point where 3 O'Clock is 0 and 12 O'Clock is 270degrees
 SeriesSelection getSeriesAndPointForScreenCoordinate(Point screenPoint)
          Fetches the SeriesSelection for the PieSegment selected.
 boolean isOnPieChart(Point screenPoint)
          Checks if Point falls within PieChart
 void setDimensions(int pieRadius, int centerX, int centerY)
          Set PieChart location on screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PieMapper

public PieMapper()
Method Detail

setDimensions

public void setDimensions(int pieRadius,
                          int centerX,
                          int centerY)
Set PieChart location on screen.

Parameters:
pieRadius -
centerX -
centerY -

areAllSegmentPresent

public boolean areAllSegmentPresent(int datasetSize)
If we have all PieChart Config then there is no point in reloading it

Parameters:
datasetSize -
Returns:
true if cfg for each segment is present

addPieSegment

public void addPieSegment(int dataIndex,
                          float value,
                          float startAngle,
                          float angle)
Add configuration for a PieChart Segment

Parameters:
dataIndex -
value -
startAngle -
angle -

clearPieSegments

public void clearPieSegments()
Clears the pie segments list.


getAngle

public double getAngle(Point screenPoint)
Fetches angle relative to pie chart center point where 3 O'Clock is 0 and 12 O'Clock is 270degrees

Parameters:
screenPoint -
Returns:
angle in degress from 0-360.

isOnPieChart

public boolean isOnPieChart(Point screenPoint)
Checks if Point falls within PieChart

Parameters:
screenPoint -
Returns:
true if in PieChart

getSeriesAndPointForScreenCoordinate

public SeriesSelection getSeriesAndPointForScreenCoordinate(Point screenPoint)
Fetches the SeriesSelection for the PieSegment selected.

Parameters:
screenPoint - - the user tap location
Returns:
null if screen point is not in PieChart or its config if it is


Copyright © 2009 - 2011 4ViewSoft. All Rights Reserved.