aspose file tools
The moose likes Other Open Source Projects and the fly likes Dynamic Jfreechart Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply Bookmark "Dynamic Jfreechart " Watch "Dynamic Jfreechart " New topic
Author

Dynamic Jfreechart

Noopur Kore
Ranch Hand

Joined: Aug 18, 2012
Posts: 77

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??
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35252
    
    7
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))


Android appsImageJ pluginsJava web charts
Noopur Kore
Ranch Hand

Joined: Aug 18, 2012
Posts: 77

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
Vishal Shaw
Ranch Hand

Joined: Aug 09, 2012
Posts: 179
Hi,

You can try this


Regards,
Vishal


Programming is about thinking, NOT coding
Noopur Kore
Ranch Hand

Joined: Aug 18, 2012
Posts: 77

Resolved. Thank you, vishal.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Dynamic Jfreechart
 
Similar Threads
Dog is not abstract and does not override abstract method
how to make a text box readonly
running applet through JSP
showing applet embedded in jsp
compareTo() method