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
* non-numeric x-axis values we don't have to read those
* values from the data model. You can look in
* ObjectChartDataModel to see, how the x-axis bounds
* are defined: the minimum value is always 0, the maximum
* value is the amount of non-numeric x-axis values.
*/
double currentvalue = 0.0;
Rectangle2D box = null;
Point2D oldmaxvalue;
Point2D oldminvalue;
for(int j = 0; j < maximumDataSetLength; j++) {
double minvalue = 0.0;
double maxvalue = 0.0;
oldmaxvalue = pointzero;
oldminvalue = pointzero;
for(int i = 0; i < m.getDataSetNumber(); i++) {
if(j < m.getDataSetLength(i))
currentvalue = m.getValueAt(i, j).doubleValue();
else
currentvalue = 0.0;
if(currentvalue < 0.0) {
minvalue += currentvalue;
yaxis1.transform(new Point2D.Float((float)j, (float)minvalue),
value);
box =
new Rectangle2D.Float((float)(value.getX()),
(float)Math.min(value.getY(), oldminvalue.getY()),
(float)boxwidth,
(float)Math.abs(oldminvalue.getY() - value.getY()));
oldminvalue = (Point2D)value.clone();
}
else {
maxvalue += currentvalue;
yaxis1.transform(new Point2D.Float((float)j, (float)maxvalue),
value);
box =
new Rectangle2D.Float((float)(value.getX()),
(float)Math.min(value.getY(), oldmaxvalue.getY()),