| 1 |
lars |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
|
2 |
<HTML>
|
|
|
3 |
<HEAD>
|
|
|
4 |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
|
|
|
5 |
<LINK REL="Start" HREF="index.html">
|
|
|
6 |
<LINK REL="Contents" HREF="toc.html">
|
|
|
7 |
<LINK REL="Prev" HREF="828Horizontalbargraphs.html">
|
|
|
8 |
<LINK REL="Next" HREF="8210Creatingsemifilledbargraphs.html">
|
|
|
9 |
<STYLE TYPE="text/css"><!--
|
|
|
10 |
BODY { font-family: serif }
|
|
|
11 |
H1 { font-family: sans-serif }
|
|
|
12 |
H2 { font-family: sans-serif }
|
|
|
13 |
H3 { font-family: sans-serif }
|
|
|
14 |
H4 { font-family: sans-serif }
|
|
|
15 |
H5 { font-family: sans-serif }
|
|
|
16 |
H6 { font-family: sans-serif }
|
|
|
17 |
SUB { font-size: smaller }
|
|
|
18 |
SUP { font-size: smaller }
|
|
|
19 |
PRE { font-family: monospace }
|
|
|
20 |
A { text-decoration: none }
|
|
|
21 |
--></STYLE>
|
|
|
22 |
</HEAD>
|
|
|
23 |
<BODY>
|
|
|
24 |
<A HREF="toc.html">Contents</A>
|
|
|
25 |
<A HREF="828Horizontalbargraphs.html">Previous</A>
|
|
|
26 |
<A HREF="8210Creatingsemifilledbargraphs.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H3><A NAME="8_2_9">8.2.9 Using gradient fill for bar graphs</A></H3>
|
|
|
29 |
<P> It is possible to use color gradient fill for the individual bars in
|
|
|
30 |
the bar graph.</P>
|
|
|
31 |
<P> Color gradient fill fills a rectangle with a smooth transition
|
|
|
32 |
between two colors. In what direction the transition goes (from left to
|
|
|
33 |
right, down and up, from the middle and out etc) is determined by the
|
|
|
34 |
style of the gradient fill. JpGraph currently supports 8 different
|
|
|
35 |
styles. All supported styles are displayed in the figure below.<DIV class="example">
|
|
|
36 |
<BR> <A href="exframes/frame_bargradsmallex1.html" target="blank"><IMG border="0"
|
|
|
37 |
HEIGHT="150" src="img/bargradsmallex1.png" WIDTH="200"></A>
|
|
|
38 |
<BR><B>Figure 44:</B> <A href="exframes/frame_bargradsmallex1.html" target="blank">
|
|
|
39 |
[src]</A>
|
|
|
40 |
<P></P>
|
|
|
41 |
</DIV></P>
|
|
|
42 |
<P><DIV class="example">
|
|
|
43 |
<BR> <A href="exframes/frame_bargradsmallex2.html" target="blank"><IMG border="0"
|
|
|
44 |
HEIGHT="150" src="img/bargradsmallex2.png" WIDTH="200"></A>
|
|
|
45 |
<BR><B>Figure 45:</B> <A href="exframes/frame_bargradsmallex2.html" target="blank">
|
|
|
46 |
[src]</A>
|
|
|
47 |
<P></P>
|
|
|
48 |
</DIV></P>
|
|
|
49 |
<P><DIV class="example">
|
|
|
50 |
<BR> <A href="exframes/frame_bargradsmallex3.html" target="blank"><IMG border="0"
|
|
|
51 |
HEIGHT="150" src="img/bargradsmallex3.png" WIDTH="200"></A>
|
|
|
52 |
<BR><B>Figure 46:</B> <A href="exframes/frame_bargradsmallex3.html" target="blank">
|
|
|
53 |
[src]</A>
|
|
|
54 |
<P></P>
|
|
|
55 |
</DIV></P>
|
|
|
56 |
<P><DIV class="example">
|
|
|
57 |
<BR> <A href="exframes/frame_bargradsmallex4.html" target="blank"><IMG border="0"
|
|
|
58 |
HEIGHT="150" src="img/bargradsmallex4.png" WIDTH="200"></A>
|
|
|
59 |
<BR><B>Figure 47:</B> <A href="exframes/frame_bargradsmallex4.html" target="blank">
|
|
|
60 |
[src]</A>
|
|
|
61 |
<P></P>
|
|
|
62 |
</DIV></P>
|
|
|
63 |
<P><DIV class="example">
|
|
|
64 |
<BR> <A href="exframes/frame_bargradsmallex5.html" target="blank"><IMG border="0"
|
|
|
65 |
HEIGHT="150" src="img/bargradsmallex5.png" WIDTH="200"></A>
|
|
|
66 |
<BR><B>Figure 48:</B> <A href="exframes/frame_bargradsmallex5.html" target="blank">
|
|
|
67 |
[src]</A>
|
|
|
68 |
<P></P>
|
|
|
69 |
</DIV></P>
|
|
|
70 |
<P><DIV class="example">
|
|
|
71 |
<BR> <A href="exframes/frame_bargradsmallex6.html" target="blank"><IMG border="0"
|
|
|
72 |
HEIGHT="150" src="img/bargradsmallex6.png" WIDTH="200"></A>
|
|
|
73 |
<BR><B>Figure 49:</B> <A href="exframes/frame_bargradsmallex6.html" target="blank">
|
|
|
74 |
[src]</A>
|
|
|
75 |
<P></P>
|
|
|
76 |
</DIV></P>
|
|
|
77 |
<P><DIV class="example">
|
|
|
78 |
<BR> <A href="exframes/frame_bargradsmallex7.html" target="blank"><IMG border="0"
|
|
|
79 |
HEIGHT="150" src="img/bargradsmallex7.png" WIDTH="200"></A>
|
|
|
80 |
<BR><B>Figure 50:</B> <A href="exframes/frame_bargradsmallex7.html" target="blank">
|
|
|
81 |
[src]</A>
|
|
|
82 |
<P></P>
|
|
|
83 |
</DIV></P>
|
|
|
84 |
<P><DIV class="example">
|
|
|
85 |
<BR> <A href="exframes/frame_bargradsmallex8.html" target="blank"><IMG border="0"
|
|
|
86 |
HEIGHT="150" src="img/bargradsmallex8.png" WIDTH="200"></A>
|
|
|
87 |
<BR><B>Figure 51:</B> <A href="exframes/frame_bargradsmallex8.html" target="blank">
|
|
|
88 |
[src]</A>
|
|
|
89 |
<P></P>
|
|
|
90 |
</DIV></P>
|
|
|
91 |
<P></P>
|
|
|
92 |
<P> To specify a gradient fill for the bar plots you make use of the
|
|
|
93 |
method <A href="../ref/BarPlot.html#_BARPLOT_SETFILLGRADIENT">
|
|
|
94 |
BarPlot::SetFillGradient()</A> . See the class reference for details of
|
|
|
95 |
this function.</P>
|
|
|
96 |
<P> When using gradient fills there are a couple of caveats you should
|
|
|
97 |
be aware of:</P>
|
|
|
98 |
<UL>
|
|
|
99 |
<LI>gradient filling is computational expensive. Large plots with
|
|
|
100 |
gradient fill will take in the order of 6 times longer to fill then for
|
|
|
101 |
a normal one-color fill. This might to some extent be helped by making
|
|
|
102 |
use of the cache feature of JpGraph so that the graph is only generated
|
|
|
103 |
a few times.</LI>
|
|
|
104 |
<LI>gradient filling will make use of much more colors (by definition)
|
|
|
105 |
this will make the color palette for the image bigger and hence make
|
|
|
106 |
the overall image larger. It might also have some severe effect on
|
|
|
107 |
using anti-aliased line in the same image as color gradient filling
|
|
|
108 |
since anti-aliased lines also have the possibility to make use of many
|
|
|
109 |
colors. Hence the color palette might not be big enough for all the
|
|
|
110 |
colors you need. So if you use gradient fills you should also be using
|
|
|
111 |
a true-color image since you otherwise run out of colors.
|
|
|
112 |
<BR> This problem is often seen as that for no apparent reason some
|
|
|
113 |
color you have specified in the image does appear as another color.
|
|
|
114 |
(This is not a bug in JpGraph!) This is something to especially watch
|
|
|
115 |
out for when enabling anti-aliasing since that also uses a lot of
|
|
|
116 |
colors. Since the numbers of colors used with anti-aliasing depends on
|
|
|
117 |
the angle on the lines it is impossible to foresee the number of colors
|
|
|
118 |
used for this.</LI>
|
|
|
119 |
</UL>
|
|
|
120 |
<P></P>
|
|
|
121 |
<HR NOSHADE>
|
|
|
122 |
<A HREF="toc.html">Contents</A>
|
|
|
123 |
<A HREF="828Horizontalbargraphs.html">Previous</A>
|
|
|
124 |
<A HREF="8210Creatingsemifilledbargraphs.html">Next</A>
|
|
|
125 |
</BODY>
|
|
|
126 |
</HTML>
|