I would like put text over each point I plotted in a line chart.
This is what I can do:
And this is what I need (names of point are in green):
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.
The
StandardXYItemLabelGeneratorshould work; there’s an example here.Addendum: The labels you can see in the picture are in a separate string array.
Such labels may be incorporated in the
XYDataset, as shown inLabeledXYDatasetbelow. Because none of the features ofStandardXYItemLabelGeneratorare used, a custom implementation ofXYItemLabelGeneratoris sufficient. TheXYItemRenderercontrols the color, size and relative position of the labels.Addendum: How can I add tooltips?
Guided by
ChartFactory.createXYLineChart(), simply specify aXYToolTipGeneratorto the renderer. The default format, seen here, isSeries: (x, y).