Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help separtating bars on my chart

 
Steve Dyke
Ranch Hand
Posts: 1619
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your input, but did you really think it was necessary to reply to a thread that is almost a year old?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic