help using XYAnnotation
help using XYAnnotation
has anyone implemented XYAnnotations in an xyplot. can I see how to do so?
Re: help using XYAnnotation
Hi Frank,
It is a very basic feature at present, it just allows you to add arbitrary text at some data coordinate:
XYPlot plot = myChart.getXYPlot();
Font font = new Font("SansSerif", Font.PLAIN, 9);
plot.addAnnotation(new XYTextAnnotation("Hello world!", font, 10.0, 75.0));
So in the example above, the text "Hello world!" will be displayed at x = 10.0 and y = 75.0 (as long as your axis ranges include those values).
I plan to extend this feature to allow adding lines, arrows and other shapes to charts, but there are lots of other things to get done first.
Regards,
Dave Gilbert
It is a very basic feature at present, it just allows you to add arbitrary text at some data coordinate:
XYPlot plot = myChart.getXYPlot();
Font font = new Font("SansSerif", Font.PLAIN, 9);
plot.addAnnotation(new XYTextAnnotation("Hello world!", font, 10.0, 75.0));
So in the example above, the text "Hello world!" will be displayed at x = 10.0 and y = 75.0 (as long as your axis ranges include those values).
I plan to extend this feature to allow adding lines, arrows and other shapes to charts, but there are lots of other things to get done first.
Regards,
Dave Gilbert
Re: help using XYAnnotation
C:\j2sdk1.4.1_01\bin>javac DSPGraph.java
DSPGraph.java:13: cannot resolve symbol
symbol : class annotations
location: package chart
import com.jrefinery.chart.annotations;
^
DSPGraph.java:229: cannot resolve symbol
symbol : class XYTextAnnotation
location: class DSPGraph
plot.addAnnotation(new XYTextAnnotation("Hello world!", 10.0, 10
.0));
^
2 errors
C:\j2sdk1.4.1_01\bin>
DSPGraph.java:13: cannot resolve symbol
symbol : class annotations
location: package chart
import com.jrefinery.chart.annotations;
^
DSPGraph.java:229: cannot resolve symbol
symbol : class XYTextAnnotation
location: class DSPGraph
plot.addAnnotation(new XYTextAnnotation("Hello world!", 10.0, 10
.0));
^
2 errors
C:\j2sdk1.4.1_01\bin>
Re: help using XYAnnotation
If I
import com.jrefinery.chart.*;
then I still get this:
C:\j2sdk1.4.1_01\bin>javac DSPGraph.java
DSPGraph.java:229: cannot resolve symbol
symbol : class XYTextAnnotation
location: class DSPGraph
plot.addAnnotation(new XYTextAnnotation("Hello world!", 10.0, 10
.0));
^
1 error
C:\j2sdk1.4.1_01\bin>
code looks like this, what you said:
XYPlot plot = chart.getXYPlot();
plot.addAnnotation(new XYTextAnnotation("Hello world!", 10.0, 10.0));
import com.jrefinery.chart.*;
then I still get this:
C:\j2sdk1.4.1_01\bin>javac DSPGraph.java
DSPGraph.java:229: cannot resolve symbol
symbol : class XYTextAnnotation
location: class DSPGraph
plot.addAnnotation(new XYTextAnnotation("Hello world!", 10.0, 10
.0));
^
1 error
C:\j2sdk1.4.1_01\bin>
code looks like this, what you said:
XYPlot plot = chart.getXYPlot();
plot.addAnnotation(new XYTextAnnotation("Hello world!", 10.0, 10.0));
Re: help using XYAnnotation
This feature would be really usefull. Identifing certain points on the graph.
Any idea of when it will be available?
Any idea of when it will be available?
Re: help using XYAnnotation
Hi Greg,
The arrows and lines feature falls into the 'easy but not so critical' category. These tasks tend to drop down my priority list, but then one day (often a Friday) I just decide out of the blue that I want to work on something easy and, voila, it's in the next release. But when I work this way, it is hard to predict the schedule.
Regards,
Dave Gilbert
The arrows and lines feature falls into the 'easy but not so critical' category. These tasks tend to drop down my priority list, but then one day (often a Friday) I just decide out of the blue that I want to work on something easy and, voila, it's in the next release. But when I work this way, it is hard to predict the schedule.
Regards,
Dave Gilbert
Re: help using XYAnnotation
Hi David,
I use a TimeSeriesChart graphic to display events occurring within a time frame.
I show a horizontal line (with the method addRangeMarker from XYPlot class) to indicate a average value.
I would like to put a "Annotation" over this average value line.
Do you have any idea of when you're going to have it avaliable?
Thanks,
Antonio Lopes
I use a TimeSeriesChart graphic to display events occurring within a time frame.
I show a horizontal line (with the method addRangeMarker from XYPlot class) to indicate a average value.
I would like to put a "Annotation" over this average value line.
Do you have any idea of when you're going to have it avaliable?
Thanks,
Antonio Lopes