BubbleRose renderer

A free public discussion forum for the JFreeChart class library.

BubbleRose renderer

Postby ddimitrov » Tue Jan 22, 2008 8:11 am

I extended the bubble renderer to display different arc section for each series. The result is that for each point of the XY plot, you get a mini rose diagram, showing the magnitude of the Z dimention of each series. This gives a clearer picture when we have multiple series with overlapping points or we have 4 or more dimentional data (in that case we map 2 dimentions to X and Y and the rest become series).


My class extends XYBubbleRenderer and I've copied the drawItem() method. Then I've changed the actual drawing code to this:

Code: Select all
            double sectorAngle = 360.0 / dataset.getSeriesCount();
            RectangularShape circle = null;
            if (orientation == PlotOrientation.VERTICAL) {
                circle = new Arc2D.Double(
                        transX - transDomain / 2.0, transY - transRange / 2.0,
                        transDomain, transRange,
                        sectorAngle * series, sectorAngle, Arc2D.PIE
                        );
            } else if (orientation == PlotOrientation.HORIZONTAL) {
                circle = new Arc2D.Double(
                        transY - transRange / 2.0, transX - transDomain / 2.0,
                        transRange, transDomain,
                        sectorAngle * series, sectorAngle, Arc2D.PIE
                        );
            }


Feel free to incorporate these changes either as an option of the bubble renderer or in a new renderer.

NOTE: if the shape creation is extracted to a protected method of XYBubbleRenderer, this would greatly reduce the amount of copied code.
ddimitrov
 
Posts: 3
Joined: Mon Jan 21, 2008 12:29 pm

Postby mhilpert » Thu Jan 24, 2008 1:29 pm

Looks good! Suggest it on the JFreeChart sourceforge page as a RFE!
using JFreeChart 1.0.15 with JDK 1.7.0_25
mhilpert
 
Posts: 493
Joined: Wed Apr 02, 2003 1:57 pm
Location: Germany


Return to JFreeChart - General

Who is online

Users browsing this forum: Bing [Bot], Exabot [Bot], Google [Bot], Yahoo [Bot] and 6 guests