Hi,
I'd like to create a barchart with 2 or more categories using XYplot, but when i add the 2nd category, it just get over the 1st one. How can I solve this to render like DefaultCategoryDataset? I'm not using DefaultCategoryDataset class because I want to write a linechart over the bars.
Ty
Luiz Eduardo
Overlayed chart with 2 bar
Re: Overlayed chart with 2 bar
Here a SS of how it is now

Uploaded with ImageShack.us
and how I want the bars show like this (including the line)

Uploaded with ImageShack.us

Uploaded with ImageShack.us
and how I want the bars show like this (including the line)

Uploaded with ImageShack.us
Re: Overlayed chart with 2 bar
Perhaps ClusteredXYBarRenderer is what you need:
http://www.jfree.org/jfreechart/api/jav ... derer.html
http://www.jfree.org/jfreechart/api/jav ... derer.html
Re: Overlayed chart with 2 bar
mkivinie thx man, that did the trick.
But now i'm facing another problem. I've mixed values of other old years and now i'm having another problem. He is priting the old years with months.
Is there any way to create categories using strings, instead of numbers or dates?
But now i'm facing another problem. I've mixed values of other old years and now i'm having another problem. He is priting the old years with months.
Is there any way to create categories using strings, instead of numbers or dates?
Re: Overlayed chart with 2 bar
You can specify what format you want the dates to appear using this method
Code: Select all
public void setDateFormatOverride(java.text.DateFormat formatter)
Re: Overlayed chart with 2 bar
Skunk,
Thx for reply, but I do not want to set same date to all data. The 1st 3 will appear only year and the other will have month.
Thx for reply, but I do not want to set same date to all data. The 1st 3 will appear only year and the other will have month.
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: Overlayed chart with 2 bar
You should be able to achieve that with a custom DateFormat implementation that is using either a default SimpleDateFormat or, if a specific condition is met, a second SimpleDateFormat.edu_neri wrote: Thx for reply, but I do not want to set same date to all data. The 1st 3 will appear only year and the other will have month.