Hello All,
I want to display the co-ordinates of the points on the XYLine chart.
If anyone has any idea let me know.
Thanks,
Scarlett
Displaying the co-ordinates for the points on XY Line series
I am using the following code to display the labels
XYItemLabelGenerator generator = new StandardXYItemLabelGenerator("{1}", new DecimalFormat("0.00"), new DecimalFormat("0.00")
);
renderer.setItemLabelGenerator(generator);
renderer.setItemLabelsVisible(true);
However using the above code you can display either the
'x' or the 'y' co-ordinate of the point. But I want to display both the 'x' and 'y' co-ordinate.
Is there a way to achieve it?
Thanks,
Scarlett
XYItemLabelGenerator generator = new StandardXYItemLabelGenerator("{1}", new DecimalFormat("0.00"), new DecimalFormat("0.00")
);
renderer.setItemLabelGenerator(generator);
renderer.setItemLabelsVisible(true);
However using the above code you can display either the
'x' or the 'y' co-ordinate of the point. But I want to display both the 'x' and 'y' co-ordinate.
Is there a way to achieve it?
Thanks,
Scarlett
I did get it
Following is the code which I have used
XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer();
XYItemLabelGenerator generator = new StandardXYItemLabelGenerator("( {1}, {2} )", new DecimalFormat("0.0"), new DecimalFormat("0.0"));
renderer.setItemLabelGenerator(generator);
The co-ordinates are displayed in the form of
(x, y)
Thanks,
Scarlett
Following is the code which I have used
XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer();
XYItemLabelGenerator generator = new StandardXYItemLabelGenerator("( {1}, {2} )", new DecimalFormat("0.0"), new DecimalFormat("0.0"));
renderer.setItemLabelGenerator(generator);
The co-ordinates are displayed in the form of
(x, y)
Thanks,
Scarlett