Contents Previous Next

8.2.8 Horizontal bar graphs

It can often come in handy to have horizontal bar graphs especially if you have a large number of values to display. Even though JpGraph doesn't directly support horizontal bar graphs this is easy achieved by constructing a normal vertical bar graph which is then rotated 90 degrees.

The example below shows a simple example of this



Figure 40: A typical horizontal bar graph with the Y-axis at the bottom [src] 

In order to achieve this effect you should study the above example carefully and you might notice two things

We finally show three more examples of horizontal bar plots. In the first plot we have hidden the Y-axis and in the second we have positioned the Y - axis at top as opposed to the bottom as the first example shows.



Figure 41: Horizontal bar graph with hidden Y axis [src] 



Figure 42: Horizontal bar graph with Y axis at the top [src] 

In the final example which is almost similar to the two first we illustrate the use of labels with more than one line.



Figure 43: Horizontal bar graph with manual integer scale as well as multiple line labels [src] 


Contents Previous Next