Blame | Letzte Änderung | Log anzeigen | RSS feed
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1"><LINK REL="Start" HREF="index.html"><LINK REL="Contents" HREF="toc.html"><LINK REL="Prev" HREF="727Usinggroupedaccumulatedbargraphs.html"><LINK REL="Next" HREF="729Usinggradientfillforbargraphs.html"><STYLE TYPE="text/css"><!--BODY { font-family: serif }H1 { font-family: sans-serif }H2 { font-family: sans-serif }H3 { font-family: sans-serif }H4 { font-family: sans-serif }H5 { font-family: sans-serif }H6 { font-family: sans-serif }SUB { font-size: smaller }SUP { font-size: smaller }PRE { font-family: monospace }A { text-decoration: none }--></STYLE></HEAD><BODY><A HREF="toc.html">Contents</A><A HREF="727Usinggroupedaccumulatedbargraphs.html">Previous</A><A HREF="729Usinggradientfillforbargraphs.html">Next</A><HR NOSHADE><H3><A NAME="7_2_8">7.2.8 Horizontal bar graphs</A></H3><P> It can often come in handy to have horizontal bar graphs especiallyif you have a large number of values to display. Even though JpGraphdoesn't directly support horizontal bar graphs this is easy achieved byconstructing a normal vertical bar graph which is then rotated 90degrees.</P><P> The example below shows a simple example of this<DIV class="example"><BR> <A href="exframes/frame_horizbarex3.html" target="blank"><IMG border="0"HEIGHT="500" src="img/img/img/img/img/img/horizbarex3.png" WIDTH="400"></A><BR><B>Figure 44:</B> A typical horizontal bar graph with the Y-axis atthe bottom <A href="exframes/frame_horizbarex3.html" target="blank">[src]</A> <P></P></DIV></P><P></P><P> In order to achieve this effect you should study the above examplecarefully and you might notice two things</P><UL><LI> We don't simply rotate the graph we also specify that we want therotation center to be the middle of the entire image. The reason forthis is that by default (See the section on rotating plots) the pivotpoint for rotation is the center of<STRONG> the plot area</STRONG>.Since the center of the plot area is not necessary the center of theentire image the rotation might be a little bit difficult to predictsince it will depend on the margins specified. <</LI><LI> The size of the plot area is determined from the original width andheight of the image taking the specified margin into account. When thethe plot area is rotated 90 degrees clockwise what was the left marginnow in effect become the upper margin and so on. This is a small nuancesince we conceptually want to specify the margins directly in therotated plot.<BR> In order to more easily handle the margin with rotated images it isrecommended that the method "Set90AndMargin()" is used. This allows theimage to be rotated as well as specifying the margins in an obviousway.</LI></UL><P> We finally show three more examples of horizontal bar plots. In thefirst plot we have hidden the Y-axis and in the second we havepositioned the Y - axis at top as opposed to the bottom as the firstexample shows.</P><P><DIV class="example"><BR> <A href="exframes/frame_horizbarex1.html" target="blank"><IMG border="0"HEIGHT="500" src="img/img/img/img/img/img/horizbarex1.png" WIDTH="400"></A><BR><B>Figure 45:</B> Horizontal bar graph with hidden Y axis <A href="exframes/frame_horizbarex1.html"target="blank">[src]</A> <P></P></DIV></P><P><DIV class="example"><BR> <A href="exframes/frame_horizbarex2.html" target="blank"><IMG border="0"HEIGHT="500" src="img/img/img/img/img/img/horizbarex2.png" WIDTH="400"></A><BR><B>Figure 46:</B> Horizontal bar graph with Y axis at the top <A href="exframes/frame_horizbarex2.html"target="blank">[src]</A> <P></P></DIV></P><P></P><P> In the final example which is almost similar to the two first weillustrate the use of labels with more than one line.<DIV class="example"><BR> <A href="exframes/frame_horizbarex4.html" target="blank"><IMG border="0"HEIGHT="500" src="img/img/img/img/img/img/horizbarex4.png" WIDTH="400"></A><BR><B>Figure 47:</B> Horizontal bar graph with manual integer scale aswell as multiple line labels <A href="exframes/frame_horizbarex4.html" target="blank">[src]</A> <P></P></DIV></P><P></P><HR NOSHADE><A HREF="toc.html">Contents</A><A HREF="727Usinggroupedaccumulatedbargraphs.html">Previous</A><A HREF="729Usinggradientfillforbargraphs.html">Next</A></BODY></HTML>