| 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="811AddingplotmarkstolineplotsXXX.html">
|
|
|
8 |
<LINK REL="Next" HREF="813Addingseveralplotstothesamegraph.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="811AddingplotmarkstolineplotsXXX.html">Previous</A>
|
|
|
26 |
<A HREF="813Addingseveralplotstothesamegraph.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H3><A NAME="8_1_2">8.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"> $lineplot</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
37 |
color="#0000BB">value</FONT><FONT color="#007700">-></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/example3.3.png" WIDTH="300"></A>
|
|
|
44 |
<BR><B>Figure 7:</B> Displaying the value for each data point <A href="exframes/frame_example3.3.html"
|
|
|
45 |
target="blank">[src]</A>
|
|
|
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"> $lineplot</FONT><FONT
|
|
|
52 |
color="#007700">-></FONT><FONT color="#0000BB">value</FONT><FONT color="#007700">
|
|
|
53 |
-></FONT><FONT color="#0000BB">SetColor</FONT><FONT color="#007700">(</FONT><FONT
|
|
|
54 |
color="#DD0000">"darkred"</FONT><FONT color="#007700">);
|
|
|
55 |
<BR></FONT><FONT color="#0000BB">$lineplot</FONT><FONT color="#007700">
|
|
|
56 |
-></FONT><FONT color="#0000BB">value</FONT><FONT color="#007700">-></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 |
-></FONT><FONT color="#0000BB">value</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
62 |
color="#0000BB">SetFormat</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">
|
|
|
63 |
"$ %0.1f"</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/example3.4.png" WIDTH="300"></A>
|
|
|
68 |
<BR><B>Figure 8:</B> Making the display values a little bit more
|
|
|
69 |
interesting <A href="exframes/frame_example3.4.html" target="blank">
|
|
|
70 |
[src]</A>
|
|
|
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 "," to separate thousands.</DIV></P>
|
|
|
78 |
<HR NOSHADE>
|
|
|
79 |
<A HREF="toc.html">Contents</A>
|
|
|
80 |
<A HREF="811AddingplotmarkstolineplotsXXX.html">Previous</A>
|
|
|
81 |
<A HREF="813Addingseveralplotstothesamegraph.html">Next</A>
|
|
|
82 |
</BODY>
|
|
|
83 |
</HTML>
|