How to create a new renderer

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

How to create a new renderer

Post by gandhi » Fri Jan 07, 2005 3:47 pm

Are there some guidelines for creating a new renderer ? I didn't find anything here nor in the developer's guide.

Of course some things can be learned from the source code (like it is a good idea to extend the AbstractRenderer). But maybe there some best practice documentation on how to do this.

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 » Fri Jan 07, 2005 4:01 pm

There isn't any good documentation for implementing your own custom renderer - yet. It would be an excellent addition to the JFreeChart Developer Guide, so I'll add it to my to do list.

Until that is done, the best advice I can give is to copy an existing renderer and start modifying it to meet your requirements.

The original idea was that renderers should be small classes that just handled the drawing of data items. In practice it turns out that more and more functions have had to be pushed from the CategoryPlot and XYPlot classes into the renderers, in order to provide flexibility. Because of this, renderers have become more complex, and as you rightly point out more documentation is required.
David Gilbert
JFreeChart Project Leader

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

gandhi
Posts: 11
Joined: Wed Nov 17, 2004 5:24 pm

Post by gandhi » Fri Jan 07, 2005 4:19 pm

ok, thanks so far.

I will try it by looking at existing renderers. I will make notes. If this does result in something worth sharing, I will post it here.

Locked