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="712Addingarbitrarytextstringstothegraph.html"><LINK REL="Next" HREF="714Addingatabtitle.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="712Addingarbitrarytextstringstothegraph.html">Previous</A><A HREF="714Addingatabtitle.html">Next</A><HR NOSHADE><H2><A NAME="7_13">7.13 Adding titles and footers to the Graph</A></H2><P> Each graph can have up to three different titles accessed by thethree properties</P><OL><LI> title</LI><LI> subtitle</LI><LI> subsubtitle</LI></OL><P> All of these three properties is a standard text object which meansthat you can have individual font, colors, margins and sizes of thesetree titles.</P><P> The only thing you need to think of is that you probably want to addsome extra margin to make room for the titles (using <A href="../ref/Graph.html#_GRAPH_SETMARGIN">Graph::SetMargin()</A> )</P><P> The individual positioning of these titles are done automaticallyand will adjust to the font size being used.</P><P> If you for, esthetic reasons, would like increase the distance fromthe top where the title is positioned (or the intra distance betweentitle and sub title) you can use the <A href="../ref/Text.html#_TEXT_SETMARGIN">Text::SetMargin()</A> method. For example the line</P><P><DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB"> $graph</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">title</FONT><FONTcolor="#007700">-></FONT><FONT color="#0000BB">SetMargin</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">20</FONT><FONT color="#007700">);</FONT><FONTcolor="#0000BB"></FONT></FONT></CODE></DIV></P><P>will set the distance between the top of the title string and the topof the graph to 20 pixels. If you instead call the SetMargin() methodfor the subtitle it will adjust the distance between the top of thesubtitle and the bottom of the title.</P><P> The titles will be positioned at the top and be centered in thegraph. Each of these titles may have multiple lines each separated by a"\n" (newline) character. By default the paragraph alignment for eachtitle is centered but may of course be changed (using theParagraphAlign()) method.</P><P> Each graph can also have a footer. This footer is actually threefooters. Left, center and right. The 'left' footer is aligned to theleft, the 'center' at the bottom center and the right to the right.</P><P> Each of these three positions is a standard Text object which meansyou can change color, font and size as you please individually on eachof these footer positions.</P><P> You access the footer through the Graph::footer property as thefollowing example shows</P><P><DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB"> $graph</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">footer</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">left</FONT><FONTcolor="#007700">-></FONT><FONT color="#0000BB">Set</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">"(C) 2002 KXY"</FONT><FONT color="#007700">);<BR></FONT><FONT color="#0000BB">$graph</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">footer</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">center</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">Set</FONT><FONTcolor="#007700">(</FONT><FONT color="#DD0000">"CONFIDENTIAL"</FONT><FONT color="#007700">);<BR></FONT><FONT color="#0000BB">$graph</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">footer</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">center</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">SetColor</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">"red"</FONT><FONTcolor="#007700">);<BR></FONT><FONT color="#0000BB">$graph</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">footer</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">center</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">SetFont</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">FF_FONT2</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">FS_BOLD</FONT><FONT color="#007700">);<BR></FONT><FONT color="#0000BB">$graph</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">footer</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">right</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">Set</FONT><FONTcolor="#007700">(</FONT><FONT color="#DD0000">"19 Aug 2002"</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV></P><P><DIV class="note"><B>Note:</B> If you enable the brand timingargument you should leave the left footer empty.</DIV></P><HR NOSHADE><A HREF="toc.html">Contents</A><A HREF="712Addingarbitrarytextstringstothegraph.html">Previous</A><A HREF="714Addingatabtitle.html">Next</A></BODY></HTML>