no scale on axis (XYBubbleRenderer)

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
vision
Posts: 16
Joined: Tue Mar 31, 2015 10:00 am
antibot: No, of course not.

no scale on axis (XYBubbleRenderer)

Post by vision » Mon Apr 13, 2015 3:59 pm

Hello,
i suggest at all who want create a bubble chart with no scale on both axis that to obtain bubble and not ellipse you just override the xybubblerenderer and make this adds

(this is an example, if your graph have PlotOrientation=vertical)

Code: Select all

          ....
          ....
            transDomain = Math.abs(transDomain);
            transRange = Math.abs(transRange);
            Ellipse2D circle = null;
            if (orientation == PlotOrientation.VERTICAL) {
               if(getScaleType()==0){
                circle = new Ellipse2D.Double(transX - z*100  / 2.0,//add
                        transY - z*100 / 2.0, z*100,z*100);//add
                }else{
                        circle = new Ellipse2D.Double(transY - transRange / 2.0,
                        transX - transDomain / 2.0,  transDomain,transRange);
                }

            }
            else if (orientation == PlotOrientation.HORIZONTAL) {
                circle = new Ellipse2D.Double(transY - transRange / 2.0,
                        transX - transDomain / 2.0, transRange, transDomain);
            } else {
                throw new IllegalStateException();
            }
            g2.setPaint(getItemPaint(series, item));
            g2.fill(circle);
            g2.setStroke(getItemOutlineStroke(series, item));
            g2.setPaint(getItemOutlinePaint(series, item));
            g2.draw(circle);
            ...
            ...

hi at all!

Locked