Problem with method

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
anamika21
Posts: 13
Joined: Mon Feb 25, 2008 3:20 pm

Problem with method

Post by anamika21 » Tue Apr 15, 2008 2:10 pm

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

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Problem with method

Post by david.gilbert » Wed Apr 16, 2008 4:43 pm

anamika21 wrote:but its giving some error
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?
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

anamika21
Posts: 13
Joined: Mon Feb 25, 2008 3:20 pm

Post by anamika21 » Thu Apr 17, 2008 12:38 pm

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

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Post by paradoxoff » Sat Apr 19, 2008 4:02 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

Code: Select all

Plot scopeXYPlot = chart.getPlot();
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.

Locked