if (string == string2)
And also how can i display the name of each genes at the top of their corresponding bar?
Ulf Dittmer wrote:
if (string == string2)
String are not compared using the == operator, they're compared using the equals method.
Ulf Dittmer wrote:
And also how can i display the name of each genes at the top of their corresponding bar?
Check out the BarRendererProcessor postprocessor and its showItemLabels attribute.
You can use == or equals for strings, it gives the same result.
Ulf Dittmer wrote:
You can use == or equals for strings, it gives the same result.
I assure you, you can't. Object equality and string value equality are not the same thing.
Have you made sure that the DefaultCategoryDataset object contains all the values you think it should contain?
on my program, the "==" works perfectly fine
Yes i think it does. I am adding the couple of values in the loop so i don't know why it wouldn't work
I think i should cast rs.getString(1) into an integer
Ulf Dittmer wrote:
on my program, the "==" works perfectly fine
How would you know that since it doesn't seem to work at all?
Ulf Dittmer wrote:
Yes i think it does. I am adding the couple of values in the loop so i don't know why it wouldn't work
I already assumed that you thought it would workBut I asked whether you have actually made sure that all data values that should be added are, in fact, added, precisely because it seems that they might not. You can print each value that gets added to System.out to make sure.
Ulf Dittmer wrote:
I think i should cast rs.getString(1) into an integer
You can't cast a string to an integer - Java isn't C. But you can use rs.getInt(1) instead.
Plus, i changed then the "==" with the "equals" like you proposed but it didn't change the results at all (neither on the tables nor on the histogram which stays empty)
The method addValue (Number, Comparable, Comparable) is ambigous for the type DefaultCategoryDataset
Ulf Dittmer wrote:
Plus, i changed then the "==" with the "equals" like you proposed but it didn't change the results at all (neither on the tables nor on the histogram which stays empty)
Well, this is at least one of the problems; there may of course be more (and apparently there are).
The method addValue (Number, Comparable, Comparable) is ambigous for the type DefaultCategoryDataset
If you look at the javadocs, you'll see that the ambiguity results from the first parameter, not the third. Try something like "ds.addValue((double)nbSeqDistinctG, "gene", new Integer(rs.getInt(1))"; you may have to experiment a bit. cewolf is from the pre-autoboxing era, so relying on that is tricky.
Ulf Dittmer wrote:Unless I'm missing something, the code looks exactly right with respect the "ds" variable. I think the problem lies elsewhere.
Have you actually counted the number of times the addValue method is called? Is the number what you expected it to be?
Do you think i can for example do something like this:
and then call this method where i created the maps for example, a bit like we usually do with displaytag?
Otherwise, that means i would have to create 20 classes for all my graphs?
Which type of graph do i need to use to have an histogram ordered on the y-axis and the x-axis (as i have integers on the x-axis)?
Also how do you use the showItemsValue in the chart?
I mean for example 85000 is before 45000 on the x-axis and i wanted to do something like on the file attached, that is to say . like on the y-axis where the values start from 0 to a certain value. I am not sure if you understand what i mean.
I have seen your example of the StackedVerticalBar but the values are multiple and inside the bars.
Montana has cold dark nights. Perfect for the heat from incandescent light. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|