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="828Horizontalbargraphs.html"><LINK REL="Next" HREF="8210Creatingsemifilledbargraphs.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="828Horizontalbargraphs.html">Previous</A><A HREF="8210Creatingsemifilledbargraphs.html">Next</A><HR NOSHADE><H3><A NAME="8_2_9">8.2.9 Using gradient fill for bar graphs</A></H3><P> It is possible to use color gradient fill for the individual bars inthe bar graph.</P><P> Color gradient fill fills a rectangle with a smooth transitionbetween two colors. In what direction the transition goes (from left toright, down and up, from the middle and out etc) is determined by thestyle of the gradient fill. JpGraph currently supports 8 differentstyles. All supported styles are displayed in the figure below.<DIV class="example"><BR> <A href="exframes/frame_bargradsmallex1.html" target="blank"><IMG border="0"HEIGHT="150" src="img/bargradsmallex1.png" WIDTH="200"></A><BR><B>Figure 44:</B> <A href="exframes/frame_bargradsmallex1.html" target="blank">[src]</A> <P></P></DIV></P><P><DIV class="example"><BR> <A href="exframes/frame_bargradsmallex2.html" target="blank"><IMG border="0"HEIGHT="150" src="img/bargradsmallex2.png" WIDTH="200"></A><BR><B>Figure 45:</B> <A href="exframes/frame_bargradsmallex2.html" target="blank">[src]</A> <P></P></DIV></P><P><DIV class="example"><BR> <A href="exframes/frame_bargradsmallex3.html" target="blank"><IMG border="0"HEIGHT="150" src="img/bargradsmallex3.png" WIDTH="200"></A><BR><B>Figure 46:</B> <A href="exframes/frame_bargradsmallex3.html" target="blank">[src]</A> <P></P></DIV></P><P><DIV class="example"><BR> <A href="exframes/frame_bargradsmallex4.html" target="blank"><IMG border="0"HEIGHT="150" src="img/bargradsmallex4.png" WIDTH="200"></A><BR><B>Figure 47:</B> <A href="exframes/frame_bargradsmallex4.html" target="blank">[src]</A> <P></P></DIV></P><P><DIV class="example"><BR> <A href="exframes/frame_bargradsmallex5.html" target="blank"><IMG border="0"HEIGHT="150" src="img/bargradsmallex5.png" WIDTH="200"></A><BR><B>Figure 48:</B> <A href="exframes/frame_bargradsmallex5.html" target="blank">[src]</A> <P></P></DIV></P><P><DIV class="example"><BR> <A href="exframes/frame_bargradsmallex6.html" target="blank"><IMG border="0"HEIGHT="150" src="img/bargradsmallex6.png" WIDTH="200"></A><BR><B>Figure 49:</B> <A href="exframes/frame_bargradsmallex6.html" target="blank">[src]</A> <P></P></DIV></P><P><DIV class="example"><BR> <A href="exframes/frame_bargradsmallex7.html" target="blank"><IMG border="0"HEIGHT="150" src="img/bargradsmallex7.png" WIDTH="200"></A><BR><B>Figure 50:</B> <A href="exframes/frame_bargradsmallex7.html" target="blank">[src]</A> <P></P></DIV></P><P><DIV class="example"><BR> <A href="exframes/frame_bargradsmallex8.html" target="blank"><IMG border="0"HEIGHT="150" src="img/bargradsmallex8.png" WIDTH="200"></A><BR><B>Figure 51:</B> <A href="exframes/frame_bargradsmallex8.html" target="blank">[src]</A> <P></P></DIV></P><P></P><P> To specify a gradient fill for the bar plots you make use of themethod <A href="../ref/BarPlot.html#_BARPLOT_SETFILLGRADIENT">BarPlot::SetFillGradient()</A> . See the class reference for details ofthis function.</P><P> When using gradient fills there are a couple of caveats you shouldbe aware of:</P><UL><LI>gradient filling is computational expensive. Large plots withgradient fill will take in the order of 6 times longer to fill then fora normal one-color fill. This might to some extent be helped by makinguse of the cache feature of JpGraph so that the graph is only generateda few times.</LI><LI>gradient filling will make use of much more colors (by definition)this will make the color palette for the image bigger and hence makethe overall image larger. It might also have some severe effect onusing anti-aliased line in the same image as color gradient fillingsince anti-aliased lines also have the possibility to make use of manycolors. Hence the color palette might not be big enough for all thecolors you need. So if you use gradient fills you should also be usinga true-color image since you otherwise run out of colors.<BR> This problem is often seen as that for no apparent reason somecolor you have specified in the image does appear as another color.(This is not a bug in JpGraph!) This is something to especially watchout for when enabling anti-aliasing since that also uses a lot ofcolors. Since the numbers of colors used with anti-aliasing depends onthe angle on the lines it is impossible to foresee the number of colorsused for this.</LI></UL><P></P><HR NOSHADE><A HREF="toc.html">Contents</A><A HREF="828Horizontalbargraphs.html">Previous</A><A HREF="8210Creatingsemifilledbargraphs.html">Next</A></BODY></HTML>