This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
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 Introducing JavaFX 8 Programming this week in the JavaFX 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

Need help separtating bars on my chart

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1543
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

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();
return tsc;
Rob Spoor

Joined: Oct 27, 2005
Posts: 20128

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

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: Need help separtating bars on my chart
It's not a secret anymore!