0.9.3 PiePlot

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Bob Nenne

0.9.3 PiePlot

Post by Bob Nenne » Mon Oct 07, 2002 9:41 pm

When running the PieChartDemo1 I'm getting a java application error - "the instruction at 0x----- referenced 0x-----. The memory could not be read." I'm using IBM's 1.2.2 JDK that came with WebSphere. Anyone have any ideas? The 0.9.2 works fine.

Bob Nenne

Re: 0.9.3 PiePlot

Post by Bob Nenne » Tue Oct 08, 2002 2:40 am

Well I answered my own question. But I dont understand the solution. In PiePlot.drawPie I changed the casts on the drawString at the bottom of the method from int to float. Funny part is that I was not executing this code. Here's the part I changed.

// draw the series label
if (label != null) {
g2.setPaint(seriesLabelPaint);
g2.setFont(seriesLabelFont);

Rectangle2D bounds = g2.getFontMetrics().getStringBounds(label, g2);
double labelX = pieX + (pieW/2) - (bounds.getWidth()/2);
double labelY = pieY + pieH + bounds.getHeight();
g2.drawString(label, (float)labelX, (float)labelY);
}

Locked