totalItemArea.height = axisChart.getYAxis().getScalePixelWidth() - 1;
totalItemArea.x = axisChart.getXAxis().getOrigin() + 1;
totalItemArea.width = axisChart.getXAxis().getPixelLength() - 1;
//---reuse the same Object for pre and post render events.
AxisValueRenderEvent axisValueRenderEvent = new AxisValueRenderEvent( axisChart,
iAxisChartDataSet,
g2d,
totalItemArea,
axisChart.getXAxis().getZeroLineCoordinate() );
//---there is only ever one data set for a regular bar chart
axisValueRenderEvent.setDataSetIndex( 0 );
//LOOP
for( int i = 0; i < iAxisChartDataSet.getNumberOfDataItems(); i++ )
{
//---reset the paint as it might have changed for the outline drawing
g2d.setPaint( iAxisChartDataSet.getPaint( 0 ) );
//---set values for the preRender event
axisValueRenderEvent.setValueX( axisChart.getXAxis().getZeroLineCoordinate() );
axisValueRenderEvent.setValueY( (float) rectangle.getCenterY() );
axisValueRenderEvent.setValueIndex( i );
//---we want to do this regardless if we render an item
barChartProperties.firePreRender( axisValueRenderEvent );
//---if value == 0 do not plot anything.
if( iAxisChartDataSet.getValue( 0, i ) != 0.0d )
{
if( iAxisChartDataSet.getValue( 0, i ) < 0 )
{
rectangle.x = axisChart.getXAxis().computeAxisCoordinate( axisChart.getXAxis().getOrigin(),
iAxisChartDataSet.getValue( 0, i ),
axisChart.getXAxis().getScaleCalculator().getMinValue() );
rectangle.width = startingX - rectangle.x;
//---set values for the postRender event
axisValueRenderEvent.setValueX( rectangle.x );
}
else
{
rectangle.x = startingX;
rectangle.width = BarChart.computeScaleHeightOfValue( iAxisChartDataSet.getValue( 0, i ),
axisChart.getXAxis().getOneUnitPixelSize() );
//---set values for the postRender event
axisValueRenderEvent.setValueX( rectangle.x + rectangle.width );
}
//---with a user defined scale, we could have non-zero data points with a height of zero.
if( rectangle.width != 0 )
{