for( int i = 0; i < pieChart2D.iPieChartDataSet.getNumberOfDataItems(); i++ )
{
int coordinateCounter = 0;
//---there are three points plus some number of subdivisions...
PolyMapArea polyMapArea = new PolyMapArea( 3 + subdivisions, pieChart2D.iPieChartDataSet.getValue( i ), null, pieChart2D.iPieChartDataSet.getLegendLabel( i ) );
polyMapArea.addCoordinate( coordinateCounter++, xPieMiddle, yPieMiddle );
//---include the first border point, plus the subdivisions
for( int h = 0; h <= subdivisions; h++ )
{
polyMapArea.addCoordinate( coordinateCounter++, imageMapPoints[counter][0], imageMapPoints[counter][1] );
counter++;
}
//---if this is the last slice, add the first calculated map point
if( ( i + 1 ) == pieChart2D.iPieChartDataSet.getNumberOfDataItems() )
{
polyMapArea.addCoordinate( coordinateCounter, imageMapPoints[0][0], imageMapPoints[0][1] );
}
//---else add the next calculated point
else
{
polyMapArea.addCoordinate( coordinateCounter, imageMapPoints[counter][0], imageMapPoints[counter][1] );
}
pieChart2D.getImageMap().addImageMapArea( polyMapArea );
}
}