XYImageAnnotation in JFreechart

Discussion in 'Java' started by Penn, Sep 14, 2007.

  1. Penn

    Penn Guest

    I have a plot that is plotting correctly and I have been adding text
    annotations to it successfully, but when I implement the following and
    add it to my working chart... I see no image in the chart. Is there
    something I should be doing additionally?

    Thanks!!!

    ImageIcon testStar = new ImageIcon("TestStar.png");

    XYImageAnnotation testStar = new XYImageAnnotation(50, 50,
    testStar.getImage());

    plot.addAnnotation(testStar);
     
    Penn, Sep 14, 2007
    #1
    1. Advertising

  2. In article <>,
    Penn <> wrote:

    > I have a plot that is plotting correctly and I have been adding text
    > annotations to it successfully, but when I implement the following and
    > add it to my working chart... I see no image in the chart. Is there
    > something I should be doing additionally?
    >
    > Thanks!!!
    >
    > ImageIcon testStar = new ImageIcon("TestStar.png");
    >
    > XYImageAnnotation testStar = new XYImageAnnotation(50, 50,
    > testStar.getImage());
    >
    > plot.addAnnotation(testStar);


    The most obvious questions would seem to be two.

    1. Are you quite certain that the PNG in question really does get
    loaded when you ask for it?

    2. Does your "plot" variable in fact refer to a class that has the
    addAnnotation method? By which I mean that I've seen some products
    where a deprecated method doesn't really do anything, and at least one
    of the classes in JFreeChart where this method is listed is deprecated.
    --
    Steve W. Jackson
    Montgomery, Alabama
     
    Steve W. Jackson, Sep 14, 2007
    #2
    1. Advertising

  3. Penn

    Penn Guest

    Thank you for the 'obvious questions', because obvious guidance was
    needed here. My ImageIcon was not loading correctly... It is now and
    JFreeChart is placing it appropriately!

    Thank you and I really appreciate your time!

    On Sep 14, 9:01 am, "Steve W. Jackson" <>
    wrote:
    > In article <>,
    >
    > Penn <> wrote:
    > > I have a plot that is plotting correctly and I have been adding text
    > > annotations to it successfully, but when I implement the following and
    > > add it to my working chart... I see no image in the chart. Is there
    > > something I should be doing additionally?

    >
    > > Thanks!!!

    >
    > > ImageIcon testStar = new ImageIcon("TestStar.png");

    >
    > > XYImageAnnotation testStar = new XYImageAnnotation(50, 50,
    > > testStar.getImage());

    >
    > > plot.addAnnotation(testStar);

    >
    > The most obvious questions would seem to be two.
    >
    > 1. Are you quite certain that the PNG in question really does get
    > loaded when you ask for it?
    >
    > 2. Does your "plot" variable in fact refer to a class that has the
    > addAnnotation method? By which I mean that I've seen some products
    > where a deprecated method doesn't really do anything, and at least one
    > of the classes in JFreeChart where this method is listed is deprecated.
    > --
    > Steve W. Jackson
    > Montgomery, Alabama
     
    Penn, Sep 14, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lordy
    Replies:
    1
    Views:
    1,160
    Lordy
    Sep 13, 2003
  2. Shripathi Kamath

    Question on JFreeChart and Batik

    Shripathi Kamath, Nov 26, 2003, in forum: Java
    Replies:
    0
    Views:
    2,324
    Shripathi Kamath
    Nov 26, 2003
  3. Bruno

    JFreeChart

    Bruno, Apr 7, 2004, in forum: Java
    Replies:
    1
    Views:
    664
    Chris Smith
    Apr 7, 2004
  4. Jochen Riekhof
    Replies:
    5
    Views:
    761
    Jochen Riekhof
    Jun 4, 2004
  5. davout
    Replies:
    2
    Views:
    5,666
    seshagirik
    Jul 6, 2006
Loading...

Share This Page