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. Advertisements

  2. 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, Sep 14, 2007
    #2
    1. Advertisements

  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!
     
    Penn, Sep 14, 2007
    #3
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.