0

how to overlay 2 xy plots, one is a horizontal orientation plot and other is a vertical orientation plot ? I want to have horizontal bar chart and a normal line chart overlaid. Both the charts share the same range axis (bar chart after it has been made horizontal). Is there a way to do this ?

enter image description here

On the left side is a bar chart with a horizontal orientation. On the right side is a line chart. I want to overlay left chart over the right chart where they will share the same y axis.

sam
  • 651
  • 3
  • 9
  • 16
  • 2
    I think this stackoverflow-post should answer all your questions: http://stackoverflow.com/questions/3807992/jfreechart-is-it-possible-to-combine-a-stacked-bars-and-line-chart-combined – mort Aug 31 '11 at 06:36
  • That question is similar but I want the bar chart to be horizontal rather than vertical as show in that particular question. I have included a pic to explain it better. – sam Aug 31 '11 at 10:40
  • So, can't you just make your bar chart a horizontal one and than overlay the line chart as shown in the link? – mort Aug 31 '11 at 11:12
  • Horizontal bar charts are created by setting the plot orientation to horizontal. However its not possible to set the orientation of one of the charts to be horizontal in an overlaid charts. The whole plot needs to be have horizontal orientation which will make the line chart to become horizontal too. Thats the problem – sam Sep 01 '11 at 01:01
  • 1
    I don't think it is possible with the same axis. You can fake it by inverting the axises on the XYPlot and setting the data accordingly. Then both will be horizontal and therefore you can overlay them. – Jes Sep 01 '11 at 04:29

0 Answers0