Package org.jfree.chart.plot

Examples of org.jfree.chart.plot.XYPlot.addAnnotation()


        XYTextAnnotation annotation
                = new XYTextAnnotation("Hello!", 50.0, 10000.0);
        annotation.setFont(new Font("SansSerif", Font.PLAIN, 9));
        annotation.setRotationAngle(Math.PI / 4.0);
        subplot1.addAnnotation(annotation);

        // create subplot 2...
        XYDataset data2 = createDataset2();
        XYItemRenderer renderer2 = new StandardXYItemRenderer();
        NumberAxis xAxis2 = new NumberAxis("X2");
View Full Code Here


    public void testRemoveAnnotation() {
        XYPlot plot = new XYPlot();
        XYTextAnnotation a1 = new XYTextAnnotation("X", 1.0, 2.0);
        XYTextAnnotation a2 = new XYTextAnnotation("X", 3.0, 4.0);
        XYTextAnnotation a3 = new XYTextAnnotation("X", 1.0, 2.0);
        plot.addAnnotation(a1);
        plot.addAnnotation(a2);
        plot.addAnnotation(a3);
        plot.removeAnnotation(a2);
        XYTextAnnotation x = (XYTextAnnotation) plot.getAnnotations().get(0);
        assertEquals(x, a1);
View Full Code Here

        XYPlot plot = new XYPlot();
        XYTextAnnotation a1 = new XYTextAnnotation("X", 1.0, 2.0);
        XYTextAnnotation a2 = new XYTextAnnotation("X", 3.0, 4.0);
        XYTextAnnotation a3 = new XYTextAnnotation("X", 1.0, 2.0);
        plot.addAnnotation(a1);
        plot.addAnnotation(a2);
        plot.addAnnotation(a3);
        plot.removeAnnotation(a2);
        XYTextAnnotation x = (XYTextAnnotation) plot.getAnnotations().get(0);
        assertEquals(x, a1);
View Full Code Here

        XYTextAnnotation a1 = new XYTextAnnotation("X", 1.0, 2.0);
        XYTextAnnotation a2 = new XYTextAnnotation("X", 3.0, 4.0);
        XYTextAnnotation a3 = new XYTextAnnotation("X", 1.0, 2.0);
        plot.addAnnotation(a1);
        plot.addAnnotation(a2);
        plot.addAnnotation(a3);
        plot.removeAnnotation(a2);
        XYTextAnnotation x = (XYTextAnnotation) plot.getAnnotations().get(0);
        assertEquals(x, a1);

        // now remove a3, but since a3.equals(a1), this will in fact remove
View Full Code Here

            s2.add(20.0, 3.5);
            dataset.addSeries(s2);
            XYPlot plot = new XYPlot(dataset,
                    new NumberAxis("X"), new NumberAxis("Y"),
                    new XYLineAndShapeRenderer());
            plot.addAnnotation(new XYBoxAnnotation(10.0, 12.0, 3.0, 4.0,
                    new BasicStroke(1.2f), Color.red, Color.blue));
            JFreeChart chart = new JFreeChart(plot);
            /* BufferedImage image = */ chart.createBufferedImage(300, 200,
                    null);
            success = true;
View Full Code Here

        XYTextAnnotation annotation = new XYTextAnnotation("Hello!", 50.0,
                10000.0);
        annotation.setFont(new Font("SansSerif", Font.PLAIN, 9));
        annotation.setRotationAngle(Math.PI / 4.0);
        subplot1.addAnnotation(annotation);

        // create subplot 2...
        XYDataset data2 = createDataset2();
        XYItemRenderer renderer2 = new StandardXYItemRenderer();
        NumberAxis rangeAxis2 = new NumberAxis("Range 2");
View Full Code Here

                     */
                    CircleDrawer cd = new CircleDrawer(
                            Color.red, new BasicStroke(1.0f), null
                            );
                    XYAnnotation locationSelected = new XYDrawableAnnotation( xx, yy, 11, 11, cd );
                    plot.addAnnotation(locationSelected);
                    XYPointerAnnotation pointer = new XYPointerAnnotation(
                            formatAnnotation( xx,  yy).toString(), xx, yy, Math.PI - knob.getAngle() );
                    pointer.setBaseRadius(35.0);
                    pointer.setTipRadius(10.0);
                    pointer.setFont(new Font("SansSerif", Font.PLAIN, 9));
View Full Code Here

                    }
                    if (Math.cos(this.knob.getAngle())<0 && Math.sin(this.knob.getAngle())>0) {
                        pointer.setLabelOffset(5.0);
                        pointer.setTextAnchor(TextAnchor.HALF_ASCENT_LEFT);
                    }
                    plot.addAnnotation(pointer);
                }
            }
        }
    }
   
View Full Code Here

              annotation = new XYTextAnnotation(text, y, x-(text.length()-1));
             
                  annotation.setFont(new Font("SansSerif", Font.PLAIN, 11));
                  //annotation.setRotationAngle(Math.PI / 4.0);
                  annotation.setRotationAngle(0.0); // horizontal
                  plot.addAnnotation(annotation);
                  cont ++;
            }
            renderer.setShape(new Ellipse2D.Double(-3, -5, 8, 8));
          }         
        }
View Full Code Here

        XYTextAnnotation annotation = new XYTextAnnotation("Hello!", 50.0,
                10000.0);
        annotation.setFont(new Font("SansSerif", Font.PLAIN, 9));
        annotation.setRotationAngle(Math.PI / 4.0);
        subplot1.addAnnotation(annotation);

        // create subplot 2...
        XYDataset data2 = createDataset2();
        XYItemRenderer renderer2 = new StandardXYItemRenderer();
        NumberAxis rangeAxis2 = new NumberAxis("Range 2");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.