Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
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="711AddingplotmarkstolineplotsXXX.html">
8
<LINK REL="Next" HREF="713Addingseveralplotstothesamegraph.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="711AddingplotmarkstolineplotsXXX.html">Previous</A>
26
<A HREF="713Addingseveralplotstothesamegraph.html">Next</A>
27
<HR NOSHADE>
28
<H3><A NAME="7_1_2">7.1.2 Displaying the values for each data point</A></H3>
29
<P> As a final easy modification we can enable the display of the data
30
 value above each data point. The value is represented by the 'value'
31
 property in the plot. (You can read more about the possibilities of the
32
 <A href="../ref/DisplayValue.html#_C_DISPLAYVALUE"> display value</A>
33
 in the class reference.)</P>
34
<P> To enable the display of the value you just need to call the Show()
35
 method of the value as in<DIV class="phpscript"><CODE><FONT color="#000000">
36
 <FONT color="#0000BB">&nbsp;$lineplot</FONT><FONT color="#007700">-&gt;</FONT><FONT
37
color="#0000BB">value</FONT><FONT color="#007700">-&gt;</FONT><FONT color="#0000BB">
38
Show</FONT><FONT color="#007700">()</FONT><FONT color="#0000BB"></FONT></FONT>
39
</CODE></DIV></P>
40
<P> Adding that line to the previous line plot would give the result
41
 shown below.<DIV class="example">
42
<BR> <A href="exframes/frame_example3.3.html" target="blank"><IMG border="0"
43
HEIGHT="200"       src="img/img/img/img/img/img/example3.3.png" WIDTH="300"></A>
44
<BR><B>Figure 8:</B> Displaying the value for each data point <A href="exframes/frame_example3.3.html"
45
target="blank">[src]</A>&nbsp;
46
<P></P>
47
</DIV></P>
48
<P> We can of course change both color, font and format of the displayed
49
 value. So for example if we wanted the display values to be dark red,
50
 use a bold font and have a '$' in front we need to add the lines<DIV class="phpscript">
51
<CODE><FONT color="#000000"> <FONT color="#0000BB">&nbsp;$lineplot</FONT><FONT
52
color="#007700">-&gt;</FONT><FONT color="#0000BB">value</FONT><FONT color="#007700">
53
-&gt;</FONT><FONT color="#0000BB">SetColor</FONT><FONT color="#007700">(</FONT><FONT
54
color="#DD0000">&quot;darkred&quot;</FONT><FONT color="#007700">);
55
<BR></FONT><FONT color="#0000BB">$lineplot</FONT><FONT color="#007700">
56
-&gt;</FONT><FONT color="#0000BB">value</FONT><FONT color="#007700">-&gt;</FONT><FONT
57
color="#0000BB">SetFont</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">
58
FF_FONT1</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
59
FS_BOLD</FONT><FONT color="#007700">);
60
<BR></FONT><FONT color="#0000BB">$lineplot</FONT><FONT color="#007700">
61
-&gt;</FONT><FONT color="#0000BB">value</FONT><FONT color="#007700">-&gt;</FONT><FONT
62
color="#0000BB">SetFormat</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">
63
&quot;$&nbsp;%0.1f&quot;</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB"></FONT>
64
</FONT></CODE></DIV></P>
65
<P> This would then result in the following image<DIV class="example">
66
<BR> <A href="exframes/frame_example3.4.html" target="blank"><IMG border="0"
67
HEIGHT="200"       src="img/img/img/img/img/img/example3.4.png" WIDTH="300"></A>
68
<BR><B>Figure 9:</B> Making the display values a little bit more
69
 interesting <A href="exframes/frame_example3.4.html" target="blank">
70
[src]</A>&nbsp;
71
<P></P>
72
</DIV></P>
73
<P><DIV class="note"><B>Note:</B> You can achieve more advanced
74
 formatting by using not just the printf() style format string by a
75
 format callback function. This could allow you to change the displayed
76
 value with more advanced formatting such as displaying money values
77
 with &quot;,&quot; to separate thousands.</DIV></P>
78
<HR NOSHADE>
79
<A HREF="toc.html">Contents</A>
80
<A HREF="711AddingplotmarkstolineplotsXXX.html">Previous</A>
81
<A HREF="713Addingseveralplotstothesamegraph.html">Next</A>
82
</BODY>
83
</HTML>