Forums Register Login

Dynamic Jfreechart

+Pie Number of slices to send: Send
Here's my code -




This is the error im gettin -

BarExample.java:21: reference to setValue is ambiguous, both method setValue(jav
a.lang.Number,java.lang.Comparable,java.lang.Comparable) in org.jfree.data.categ
ory.DefaultCategoryDataset and method setValue(double,java.lang.Comparable,java.
lang.Comparable) in org.jfree.data.category.DefaultCategoryDataset match
dataset.setValue(rs.getInt(1), "Profit %", rs.getInt(2));
^
1 error


I don't understand. What's the deal here??
+Pie Number of slices to send: Send
It's like the message says: the DefaultCategoryDataset class has two methods that would match the parameters that you're providing. Check out the javadocs of that class for details. You need to make it clear which of the two methods you want to invoke (although, actually, invoking either of them will have the same result). You can do this either by calling

dataset.setValue(new Integer(rs.getInt(1)), "Profit %", rs.getInt(2))

(which I'd prefer) or

dataset.setValue((double) rs.getInt(1), "Profit %", rs.getInt(2))
+Pie Number of slices to send: Send
Tried What you told me. Still the same error.

BarExample.java:21: reference to setValue is ambiguous, both method setValue(jav
a.lang.Number,java.lang.Comparable,java.lang.Comparable) in org.jfree.data.categ
ory.DefaultCategoryDataset and method setValue(double,java.lang.Comparable,java.
lang.Comparable) in org.jfree.data.category.DefaultCategoryDataset match
dataset.setValue(new Integer(rs.getInt(1)), "Profit %", rs.getInt(2));
^
1 error
+Pie Number of slices to send: Send
Hi,

You can try this


Regards,
Vishal
+Pie Number of slices to send: Send
Resolved. Thank you, vishal.
Could you hold this puppy for a sec? I need to adjust this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 884 times.
Similar Threads
running applet through JSP
compareTo() method
Dog is not abstract and does not override abstract method
showing applet embedded in jsp
how to make a text box readonly
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 04:36:11.