XYBarDataset: no getter or setter for underlying dataset?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
MattBallard
Posts: 29
Joined: Wed Jun 06, 2007 7:41 pm

XYBarDataset: no getter or setter for underlying dataset?

Post by MattBallard » Tue Dec 04, 2007 9:09 pm

I am running 1.0.3 version of JFreeChart and have extended the XYBarRenderer. I need to have access to the underlying dataset within the XYBarRenderer, is this possible? Currently there is only the XYBarDataset instance within the Renderer.

I need access to the underlying dataset because I have extended the underlying dataset to be a specialized dataset of my own. Come time to draw the bars I need to know if the underlying dataset is an instanceof the specialized dataset that I designed. If it is thenI want to draw a bar around the XYBarDataset.

my best guess is there is no way to accomplish this without extending/overwriting the XYBarRenderer class.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Dec 05, 2007 3:49 pm

The drawItem() method, which is where you'll actually draw the bars, has a 'dataset' argument that you can use.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

MattBallard
Posts: 29
Joined: Wed Jun 06, 2007 7:41 pm

Post by MattBallard » Wed Dec 05, 2007 3:52 pm

Thanks for your response david. We updated to version 1.0.6 and the getUnderlyingDataset() in XYBarDataset solved our problems.

What is the most stable build? We have to put together justification for updating from 1.0.3 to the most stable build. Looks like our development project is going to require us to justify upgrading to a newer version.

thanks again for your response

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Dec 05, 2007 4:14 pm

MattBallard wrote:Thanks for your response david. We updated to version 1.0.6 and the getUnderlyingDataset() in XYBarDataset solved our problems.
OK, I misunderstood your question.
MattBallard wrote:What is the most stable build? We have to put together justification for updating from 1.0.3 to the most stable build. Looks like our development project is going to require us to justify upgrading to a newer version.
I'd use the latest (1.0.8 ) or, if you are concerned because it has only been out for a short time, use 1.0.6 (which had 80,000 downloads and no critical problems).
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked