I have an XYSeries to which I add values from a HashMap. I’d like the datapoints on the graph to have labels on them based on the key value in the HashMap.
So my question is, how do you create custom data point labels in JFreeChart?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
An
XYItemLabelGeneratorworks well. If the standard one, discussed here, is not sufficient, you can always overridegenerateLabel()to access yourMap.Addendum: In outline, your generator would look something like this:
And you would install it in your renderer as shown in the example.