wood burning stoves 2.0*
The moose likes Other JSE/JEE APIs and the fly likes Need help separtating bars on my chart Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Need help separtating bars on my chart" Watch "Need help separtating bars on my chart" New topic
Author

Need help separtating bars on my chart

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1439
    
    1
I have the following code that generates an overlaid chart with three data series. Two bars and one line. I nees the two bars to be displayed side by side instead of on top of each other.

Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
That is a lot of code and docs to dig through on an api I have never seen but I do not see any vars in Plot that can be used to set each bar at some X-Position on a chart. There is plenty for Y-Scaling and putting a graphical up. Did you write this code? Looks like it came from an IDE ( a remarkable one )
ron cook
Greenhorn

Joined: Apr 09, 2009
Posts: 3
Use ClusteredXYBarRenderer instead of XYBarRenderer:
ClusteredXYBarRenderer renderer1 = new ClusteredXYBarRenderer(0.20, false);

Also, combine series1 and series3 into one dataset like this:
TimeSeriesCollection tsc = new TimeSeriesCollection();
tsc.addSeries(series1);
tsc.addSeries(series3);
tsc.setXPosition(TimePeriodAnchor.MIDDLE);
return tsc;
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19684
    
  20

Thanks for your input, but did you really think it was necessary to reply to a thread that is almost a year old?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
jQuery in Action, 2nd edition
 
subject: Need help separtating bars on my chart