XYDotRenderer with Dynamic DotWidth DotHeight ?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
purduephotog
Posts: 17
Joined: Wed Nov 10, 2004 11:29 pm

XYDotRenderer with Dynamic DotWidth DotHeight ?

Post by purduephotog » Mon Mar 19, 2007 8:38 pm

Hello-

I have a large dataset (5x 30k points) that is viewed in several different JPanels. All of the panels (save one) are linked now on zoom as to go to the proper locations.

I now need, however, to make the individual points 'larger' as a 1x1 pixel, while looking great for this large dataset on the graph, is too difficult to see on zoom in.

Repainting each graph/zoom takes approximately 3 seconds- my data is static and won't change during that time period.

I've searched but I must not have used the correct terms- ideas are most welcome.

Jason

Kousu
Posts: 63
Joined: Wed Mar 07, 2007 10:40 pm

Post by Kousu » Mon Mar 19, 2007 8:42 pm

I'm not entirely sure what your problem is, let me restate it as I understand it:

You want to make your datapoints multiple pixels wide?

You can do this by writing a custom XYItemRenderer.

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 » Tue Mar 20, 2007 6:35 am

You'll need to modify the XYDotRenderer to achieve this. All that needs changing is the drawItem() method, where the fixed width and height are used to draw the data items. You need to scale these according to your axis range - the scale factor is going to be dependent on the range of values in your dataset, so you'll probably want to make that configurable.
David Gilbert
JFreeChart Project Leader

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

purduephotog
Posts: 17
Joined: Wed Nov 10, 2004 11:29 pm

Post by purduephotog » Tue Mar 27, 2007 9:04 pm

Thanks Dave-

I was afraid you'd say that :)

I will have to try and make it settable- once it's updated with the size, I would think I can notify it to auto update/draw again.

I'm wondering and I've searched, but I haven't found- is there any observer / observable code here to be used?

Locked