I am trying develop a bar chart which paints images such as discs instead of a bar as shown in the following image. I am able to display the icons on the axis, its the actual bar I am struggling with.
I also posted this question on stackoverflow, the url is
http://stackoverflow.com/questions/3805 ... jfreechart
I have tried applying a new painter to the renderer as show below, but it's still painting the normal bar.
Code: Select all
renderer.setBarPainter(new StandardBarPainter()
{
public void paintBar(Graphics2D g2, BarRenderer renderer, int row, int column, RectangularShape bar, RectangleEdge base)
{
Paint itemPaint = renderer.getItemPaint(row, column);
GradientPaintTransformer t = renderer.getGradientPaintTransformer();
if (t != null && itemPaint instanceof GradientPaint) {
itemPaint = t.transform((GradientPaint) itemPaint, bar);
}
ImageIcon img = new ImageIcon(MoodGraphUtil.class.getResource("/com/engage/utils/disc.png"));
g2.drawImage(img.getImage(), bar.getBounds().x, bar.getBounds().x, img.getImageObserver());
}
public boolean equals(Object obj) {
return true;
}
});
Any help will be much appreciated.
Kind regards, Mukhtar.