Hello,
I have implemented the code of mouselistener but its giving some error ..i dont know what to do?
marker.setLabelOffsetType(LengthAdjustmentType.EXPAND);
marker.setLabelFont(markerLabelFont);
marker.setStroke(markerStroke);
scopeXYPlot.removeDomainMarker(marker);
marker is a type of valuemarker and using that i want to access setLabelFont,setStroke and like that but it says dont know method markerLabelFont or markerStroke ....
how can i solve it? can someone give me some hint?
Regards,
Anamika
Problem with method
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Problem with method
Most of the time (not always), Java error messages are quite descriptive. They tell you what has gone wrong, and where. What does your error message say, exactly?anamika21 wrote:but its giving some error
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


1) marker.setLabelOffsetType(LengthAdjustmentType.EXPAND);
for the above code it says -
cannot find symbol - method setLabelOffsetType(org.jfree.ui.LengthAdjustmentType)
2) marker.setLabelFont(markerLabelFont);
cannot find sysmbol - variable markerLabelFont
3) marker.setStroke(markerStroke);
cannot find symbol - variable markerStroke
4)scopeXYPlot.removeDomainMarker(marker);
canot find symbol - method removeDomainMarker(org.jfree.chart.plot.ValueMarker)
6)scopeXYPlot.removeRangeMarker(marker);
canot find symbol - method removeRangeMarker((org.jfree.chart.plot.ValueMarker)
7) scopeChartComposite.update();
cannot find symbol - variable scopeChartComposite
8)XLabel.setText(String.format("X: (Sec)%s%8.4f", NL, crossHairX));
YLabel.setText(String.format("Y: (P/U)%s%8.4f", NL, crossHairY));
cannot find symbol - variable XLabel and YLabel
could you please tell me how to solve this??
Regards,
Anamika
for the above code it says -
cannot find symbol - method setLabelOffsetType(org.jfree.ui.LengthAdjustmentType)
2) marker.setLabelFont(markerLabelFont);
cannot find sysmbol - variable markerLabelFont
3) marker.setStroke(markerStroke);
cannot find symbol - variable markerStroke
4)scopeXYPlot.removeDomainMarker(marker);
canot find symbol - method removeDomainMarker(org.jfree.chart.plot.ValueMarker)
6)scopeXYPlot.removeRangeMarker(marker);
canot find symbol - method removeRangeMarker((org.jfree.chart.plot.ValueMarker)
7) scopeChartComposite.update();
cannot find symbol - variable scopeChartComposite
8)XLabel.setText(String.format("X: (Sec)%s%8.4f", NL, crossHairX));
YLabel.setText(String.format("Y: (P/U)%s%8.4f", NL, crossHairY));
cannot find symbol - variable XLabel and YLabel
could you please tell me how to solve this??
Regards,
Anamika
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
For "cannot find symbol - variable markerLabelFont, markerStroke , scopeChartComposite, XLabel, YLabel " I assume that these variables are not declared in the context in which they are used.
For "cannot find symbol - method setLabelOffsetType(org.jfree.ui.LengthAdjustmentType)
removeDomainMarker(org.jfree.chart.plot.ValueMarker)
removeRangeMarker((org.jfree.chart.plot.ValueMarker)"
I assume that you are trying to invoke methods of objects that are not declared properly. For example if you get your scopeXYPlot by
Java assumes that the object is of type Plot. You may know that it is in fact an XYPlot, but Java can´t know that unless you have explicitly casted your object.
For "cannot find symbol - method setLabelOffsetType(org.jfree.ui.LengthAdjustmentType)
removeDomainMarker(org.jfree.chart.plot.ValueMarker)
removeRangeMarker((org.jfree.chart.plot.ValueMarker)"
I assume that you are trying to invoke methods of objects that are not declared properly. For example if you get your scopeXYPlot by
Code: Select all
Plot scopeXYPlot = chart.getPlot();