how to show image in jfreechart

Posted on 2008-11-05
Last Modified: 2012-06-22
I want to show an image instead of a shape for each item in my xy scatter plot using JFreeChart. I was able to extend xylineandshaperenderer to draw an image but i can show the same image for each item. I want to show image specific to each item. I looked at the source code, the code uses int to represent an item(as against an object), it makes difficult to modify it, any ideas to do it in the simplest way?
Question by:npl77
    LVL 86

    Accepted Solution

    You would properly have to override a paint/paintComponent method. Try using the int as a index into a map-like structure

    Author Comment

    thanks CEHJ, i thought of doing that, actually i am getting data from use int as index, i'll have to write the dataset myself..i don't think of any easier way, i guess thats the only way to go, i was wondering if there is a better way, the source code of jfreechart is by no means object oriented and not extensible but after all its free, so i've no right to complain :)
    LVL 86

    Expert Comment


    Perhaps you could have a look at this too?

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
    Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
    This video teaches viewers about errors in exception handling.
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now