Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Need help separtating bars on my chart

 
Ranch Hand
Posts: 1951
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.

 
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 )
 
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;
 
Sheriff
Posts: 21817
104
Eclipse IDE Spring VI Editor Chrome Java Ubuntu 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?
 
Because those who mind don't matter and those who matter don't mind - Seuss. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!