public class PieMapper

  1. Object
  2. PieMapper
PieChart Segment Selection Management.

Constructors

public PieMapper()

Methods

public void setDimensions(int pieRadius, int centerX, int centerY)Set PieChart location on screen.
public boolean areAllSegmentPresent(int datasetSize)If we have all PieChart Config then there is no point in reloading it
public void addPieSegment(int dataIndex, float value, float startAngle, float angle)Add configuration for a PieChart Segment
public void clearPieSegments()Clears the pie segments list.
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
public boolean isOnPieChart(Point screenPoint)Checks if Point falls within PieChart
public SeriesSelection getSeriesAndPointForScreenCoordinate(Point screenPoint)Fetches the SeriesSelection for the PieSegment selected.
public Shape getSegmentShape(int dataIndex)

Inherited methods

Constructor details

PieMapper

public PieMapper()

Method details

setDimensions

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

areAllSegmentPresent

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

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

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

Returns

angle in degress from 0-360.

isOnPieChart

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

Returns

true if in PieChart

getSeriesAndPointForScreenCoordinate

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

Parameters

screenPoint Point
  • the user tap location

Returns

null if screen point is not in PieChart or its config if it is

getSegmentShape

public Shape getSegmentShape(int dataIndex)