This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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 Android Security Essentials Live Lessons this week in the Android 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: 1394
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: 19655
    
  18

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help separtating bars on my chart
 
Similar Threads
Displaying scalable vector graphics on ibm aix
startActivity error for Android graph view
Problems with writing image on server side
Checking for No Value
Display Bar Values in Chart