| 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="109Moreformattingforbars.html">
|
|
|
8 |
<LINK REL="Next" HREF="1092Addingprogressindicatorstobars.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="109Moreformattingforbars.html">Previous</A>
|
|
|
26 |
<A HREF="1092Addingprogressindicatorstobars.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H3><A NAME="10_9_1">10.9.1 Adding caption to bars</A></H3>
|
|
|
29 |
<P> Caption for bars are placed at the far right side of the bars. They
|
|
|
30 |
can for example be used to indicate the resources assigned to a task,
|
|
|
31 |
the duration of the task or the progress of the activity.</P>
|
|
|
32 |
<P> Caption text for a bar is specified either when creating a bar or
|
|
|
33 |
later by accessing the 'caption' property of bars. So the two lines<DIV class="phpscript">
|
|
|
34 |
<CODE><FONT color="#000000"> <FONT color="#0000BB"> $activity </FONT><FONT
|
|
|
35 |
color="#007700">= new </FONT><FONT color="#0000BB">GanttBar</FONT><FONT color="#007700">
|
|
|
36 |
(</FONT><FONT color="#0000BB">0</FONT><FONT color="#007700">,</FONT><FONT
|
|
|
37 |
color="#DD0000">"Activity 1"</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">
|
|
|
38 |
"2001-11-21"</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">
|
|
|
39 |
"2001-12-20"</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">
|
|
|
40 |
"[BS,ER]"</FONT><FONT color="#007700">)</FONT><FONT color="#0000BB"></FONT>
|
|
|
41 |
</FONT></CODE></DIV></P>
|
|
|
42 |
<P> and<DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
|
|
|
43 |
$activity</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">
|
|
|
44 |
caption</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">Set</FONT><FONT
|
|
|
45 |
color="#007700">(</FONT><FONT color="#DD0000">"[BS,ER]"</FONT><FONT color="#007700">
|
|
|
46 |
);</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV></P>
|
|
|
47 |
<P> are both ways of specifying the caption "[BS,ER]" for the activity.
|
|
|
48 |
Since activity is a standard JpGraph text object you can easily modify
|
|
|
49 |
font, color and size with calls to SetFont() and SetColor(), (e.g.<DIV class="phpscript">
|
|
|
50 |
<CODE><FONT color="#000000"> <FONT color="#0000BB"> $activity</FONT><FONT
|
|
|
51 |
color="#007700">-></FONT><FONT color="#0000BB">caption</FONT><FONT color="#007700">
|
|
|
52 |
-></FONT><FONT color="#0000BB">SetFont</FONT><FONT color="#007700">(</FONT><FONT
|
|
|
53 |
color="#0000BB">FF_ARIAL</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
|
|
|
54 |
FF_BOLD</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">9</FONT><FONT
|
|
|
55 |
color="#007700">);</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV>
|
|
|
56 |
</P>
|
|
|
57 |
<P></P>
|
|
|
58 |
<P> The figure below illustrates the use of caption<DIV class="example">
|
|
|
59 |
<BR> <A href="exframes/frame_ganttex13.html" target="blank"><IMG border="0"
|
|
|
60 |
HEIGHT="186" src="img/ganttex13.png" WIDTH="409"></A>
|
|
|
61 |
<BR><B>Figure 157:</B> Illustration of the use of captions <A href="exframes/frame_ganttex13.html"
|
|
|
62 |
target="blank">[src]</A>
|
|
|
63 |
<P></P>
|
|
|
64 |
</DIV></P>
|
|
|
65 |
<P></P>
|
|
|
66 |
<HR NOSHADE>
|
|
|
67 |
<A HREF="toc.html">Contents</A>
|
|
|
68 |
<A HREF="109Moreformattingforbars.html">Previous</A>
|
|
|
69 |
<A HREF="1092Addingprogressindicatorstobars.html">Next</A>
|
|
|
70 |
</BODY>
|
|
|
71 |
</HTML>
|