XYBlockRenderer BlockHeight

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
miladirooni
Posts: 24
Joined: Fri Sep 04, 2009 10:28 am
antibot: No, of course not.

XYBlockRenderer BlockHeight

Post by miladirooni » Sat Aug 07, 2010 5:59 pm

Is there any way that I cloud set Block height in xyzDataset so that first series has Block height of say 10 and the second series has block height of 20.
Image

I know to set block height we do this:

Code: Select all

XYBlockRenderer renderer = new XYBlockRenderer;
renderer.setBlockHeight(10);
but this apply block height to all of the series in the chart. I also tried the following code:

Code: Select all

XYBlockRenderer renderer = (XYBlockRenderer) xyplot.getRenderer(1);
renderer.setBlockHeight(10);
but still wont work it applies it to all the series in the chart.
Dose anyone have any suggestion how to over come this issue that i'm facing?

Cheers

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: XYBlockRenderer BlockHeight

Post by paradoxoff » Tue Aug 10, 2010 9:03 pm

What you want is not possible with the XYBlockRenderer in its present form.
I wonder why you need that? Maybe you could post an image that is showing what you have, and the you can describe what you want.
The screenshot (with an apparent block height and block width of 1) does not seem to come from the snippet you have posted (with a block height of 10).

miladirooni
Posts: 24
Joined: Fri Sep 04, 2009 10:28 am
antibot: No, of course not.

Re: XYBlockRenderer BlockHeight

Post by miladirooni » Wed Aug 11, 2010 2:44 pm

HI Paradoxoff
Tanx for replying. I'm writing an open source application for scientist at my work place, the purpose application is for visualization of some data that is produced as result of some experiments. For example they something like this first column(Num) is file 1, file2, and so on second column is Pressure(P) and third column is temperature(T) these columns only effects Y axis. so as you can see if they want to plot as function file number then its easy because block height is constant however if they want to plot as function temperature or pressure then Im facing a problem since they are usually vary so block height cant be constant as it is in first case.

Code: Select all

Num	P	T   ........
1	10	5
2	15	10
3	16	12
4	20	30
5	23	34
6	24	45
7	28	47
8	29	50
9	30	52
10	32	53
11	40	58
the first chart as File number(the order which files are produced in experiment)
Image
this for example as function of pressure which dosen't look good
Image

Do you see my problem now?

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: XYBlockRenderer BlockHeight

Post by paradoxoff » Thu Aug 12, 2010 10:27 pm

I think the only way to get what you want is to subclass XYBlockRenderer and introduce the possibility to use series specific block widths and heights.
Depending on how your data is organized in series and items, you could also create a new renderer that determines the difference between the y values dynamically and adjusts the block sizes accordingly.

Locked