/** Finally renders the Object in the Graphics object.
* @param g the Graphics2D object in which to render
*/
public void renderChart(Graphics2D g) {
ChartDataModel m = getChartDataModel();
ChartDataModelConstraints con = m.getChartDataModelConstraints(CoordSystem.FIRST_YAXIS);
System.out.println("** Maximum: "+con.getMaximumValue()+" Minimum: "+con.getMinimumValue());
if(m.isColumnNumeric())
return;
RowColorModel rcm = getRowColorModel();
AffineTransform yaxis1 = getTransform(CoordSystem.FIRST_YAXIS);
int datasetcount = m.getDataSetNumber();
int maximumDataSetLength = Integer.MIN_VALUE;
for(int i = 0; i < model.getDataSetNumber(); i++) {
maximumDataSetLength = Math.max(maximumDataSetLength, model.getDataSetLength(i));
}
Point2D pointzero;
if(con.getMinimumValue().floatValue() > 0)
pointzero = yaxis1.transform(new Point2D.Float((float)con.getMinimumColumnValue(),
con.getMinimumValue().floatValue()),
null);
else if(con.getMaximumValue().floatValue() < 0)
pointzero = yaxis1.transform(new Point2D.Float((float)con.getMinimumColumnValue(),
con.getMaximumValue().floatValue()),
null);
else
pointzero = yaxis1.transform(new Point2D.Float((float)con.getMinimumColumnValue(),
0f),
null);
Point2D point1 = yaxis1.transform(new Point2D.Float((float)con.getMinimumColumnValue(),
con.getMaximumValue().floatValue()),
null);
Point2D point2 = yaxis1.transform(new Point2D.Float((float)con.getMaximumColumnValue(),
con.getMaximumValue().floatValue()),
null);
Point2D value = point1;
int dataunitwidth = (int)((point2.getX() - point1.getX()) / con.getMaximumColumnValue());
int boxwidth = (int)(dataunitwidth * boxWidth);
float margin = (float)(dataunitwidth * ((1.0 - boxWidth)/2f));
/* We paint the values starting at x-value "0".
* As we only render BarCharts for ChartDataModels with