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="7116ConstructingsmoothlineplotswithCubicSplines.html">
8
<LINK REL="Next" HREF="72Bargraphs.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="7116ConstructingsmoothlineplotswithCubicSplines.html">Previous</A>
26
<A HREF="72Bargraphs.html">Next</A>
27
<HR NOSHADE>
28
<H3><A NAME="7_1_17">7.1.17 Adding plot marks to a line plot</A></H3>
29
<P> To emphasize the specific data points it is possible to add plot
30
 marks at each data point. Plot marks can be either</P>
31
<UL>
32
<LI> Simple shapes, (e.g. square, circle, cross, etc)</LI>
33
<LI> Arbitrary images loaded from a file</LI>
34
<LI> One of the built-in images</LI>
35
</UL>
36
<P> You access the plot mark through the &quot;mark&quot; instance variable in the
37
 plot, as in<DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
38
&nbsp;$lineplot</FONT><FONT color="#007700">-&gt;</FONT><FONT color="#0000BB">
39
mark</FONT><FONT color="#007700">-&gt;</FONT><FONT color="#0000BB">SetColor</FONT><FONT
40
color="#007700">(</FONT><FONT color="#DD0000">&quot;red&quot;</FONT><FONT color="#007700">
41
);</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV></P>
42
<P> To choose between the different plot marks you call the <A href="../ref/PlotMark.html#_PLOTMARK_SETTYPE">
43
PlotMark::SetType()</A> method with the correct define to choose the
44
 plot type you want to use.</P>
45
<P> The simple shape type of plot marks are</P>
46
<UL>
47
<LI> MARK_SQUARE</LI>
48
<LI> MARK_UTRIANGLE</LI>
49
<LI> MARK_DTRIANGLE</LI>
50
<LI> MARK_DIAMOND</LI>
51
<LI> MARK_CIRCLE</LI>
52
<LI> MARK_FILLEDCIRCLE</LI>
53
<LI> MARK_CROSS</LI>
54
<LI> MARK_STAR</LI>
55
<LI> MARK_X</LI>
56
<LI> MARK_LEFTTRIANGLE</LI>
57
<LI> MARK_RIGHTTRIANGLE</LI>
58
<LI> MARK_FLASH</LI>
59
</UL>
60
<P> To specify an arbitrary image you use the special define</P>
61
<UL>
62
<LI> MARK_IMG</LI>
63
</UL>
64
<P> In this case you must also specify a image file name and an optional
65
 scaling constant. For example as in<DIV class="phpscript"><CODE><FONT color="#000000">
66
 <FONT color="#0000BB">&nbsp;$lineplot</FONT><FONT color="#007700">-&gt;</FONT><FONT
67
color="#0000BB">mark</FONT><FONT color="#007700">-&gt;</FONT><FONT color="#0000BB">
68
SetTYPE</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">
69
MARK_IMG</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">
70
&quot;myimage.jpg&quot;</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
71
1.5</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB"></FONT></FONT>
72
</CODE></DIV></P>
73
<P></P>
74
<P> If you want to use one of the built-in images the following images
75
 are available. Please note that not all images are available in all
76
 possible colors. The available colors for each image is listed below.</P>
77
<P> The following shape (the first class) plot marks are available</P>
78
<OL>
79
<LI>MARK_SQUARE, A filled square</LI>
80
<LI>MARK_UTRIANGLE, A triangle pointed upwards</LI>
81
<LI>MARK_DTRIANGLE, A triangle pointed downwards</LI>
82
<LI>MARK_DIAMOND, A diamond</LI>
83
<LI>MARK_CIRCLE, A circle</LI>
84
<LI>MARK_FILLEDCIRCLE, A filled circle</LI>
85
<LI>MARK_CROSS, A cross</LI>
86
<LI>MARK_STAR, A star</LI>
87
<LI>MARK_X, An 'X'</LI>
88
<LI>MARK_FLASH, A &quot;flash&quot; shape</LI>
89
<LI>MARK_IMAGE, Use the image specified with the filename and scale as
90
 the second and third argument as the mark.</LI>
91
</OL>
92
<P></P>
93
<P> For the second class (built-in images) the following table list the
94
 different images as well as what color they are available in. For the
95
 built-in images you specify the color with the second argument.</P>
96
<P> Note that some of the images are available in different sizes. The
97
 reason is that even though you can scale them by the third argument
98
 there is a visual degradation to scale an image larger than it's
99
 original size since some pixels needs to be interpolated. Reducing the
100
 size with a scale &lt; 1.0 gives much better visual apperance.</P>
101
<P> The scaling works with both GD 1 and GD 2 but with GD 2 the quality
102
 of the scaling is much better.</P>
103
<P> Built-in images and available colors:</P>
104
<TABLE border="1">
105
<TR><TH>Type</TH><TH>Description</TH><TH>Colors</TH></TR>
106
<TR><TD>MARK_IMG_PUSHPIN, MARK_IMG_SPUSHPIN</TD><TD> Push-pin image</TD><TD>
107
'red','blue','green','pink','orange'</TD></TR>
108
<TR><TD>MARK_IMG_LPUSHPIN</TD><TD> A larger Push-pin image</TD><TD>
109
'red','blue','green','pink','orange'</TD></TR>
110
<TR><TD>MARK_IMG_BALL, MARK_IMAGE_SBALL</TD><TD>A round 3D rendered ball</TD><TD>
111
'bluegreen','cyan','darkgray','greengray',
112
 'gray','graypurple','green','greenblue','lightblue',
113
 'lightred','navy','orange','purple','red','yellow'</TD></TR>
114
<TR><TD>MARK_IMAGE_MBALL</TD><TD>A medium sized round 3D rendered ball</TD><TD>
115
 'blue','bluegreen','brown','cyan',
116
 'darkgray','greengray','gray','green',
117
 'greenblue','lightblue','lightred', 'purple','red','white','yellow'</TD>
118
</TR>
119
<TR><TD>MARK_IMAGE_LBALL</TD><TD>A large sized round 3D rendered ball</TD><TD>
120
 'blue','lightblue','brown','darkgreen',
121
 'green','purple','red','gray','yellow','silver','gray'</TD></TR>
122
<TR><TD>MARK_IMAGE_SQUARE</TD><TD>A 3D rendered square</TD><TD>
123
'bluegreen','blue','green', 'lightblue','orange','purple','red','yellow'</TD>
124
</TR>
125
<TR><TD>MARK_IMG_STAR</TD><TD>A 3D rendered star image</TD><TD>
126
'bluegreen','lightblue','purple','blue','green','pink','red','yellow'</TD>
127
</TR>
128
<TR><TD>MARK_IMG_DIAMOND</TD><TD>A 3D rendered diamond</TD><TD>
129
'lightblue','darkblue','gray', 'blue','pink','purple','red','yellow'</TD>
130
</TR>
131
<TR><TD>MARK_IMG_BEVEL</TD><TD>A 3D rendered bevel style round ring</TD><TD>
132
'green','purple','orange','red','yellow'</TD></TR>
133
</TABLE>
134
 Below we give two examples of images using these features.<DIV class="example">
135
<BR> <A href="exframes/frame_imgmarkerex1.html" target="blank"><IMG border="0"
136
HEIGHT="200"       src="img/img/img/img/img/img/imgmarkerex1.png" WIDTH="300"></A>
137
<BR><B>Figure 29:</B> Using an arbitrary image as plot mark <A href="exframes/frame_imgmarkerex1.html"
138
target="blank">[src]</A>&nbsp;
139
<P></P>
140
</DIV>
141
<P></P>
142
<P><DIV class="example">
143
<BR> <A href="exframes/frame_builtinplotmarksex1.html" target="blank"><IMG
144
border="0" HEIGHT="200"       src="img/img/img/img/img/img/builtinplotmarksex1.png" WIDTH="350"></A>
145
<BR><B>Figure 30:</B> Using the built-in images <A href="exframes/frame_builtinplotmarksex1.html"
146
target="blank">[src]</A>&nbsp;
147
<P></P>
148
</DIV></P>
149
<P></P>
150
<HR NOSHADE>
151
<A HREF="toc.html">Contents</A>
152
<A HREF="7116ConstructingsmoothlineplotswithCubicSplines.html">Previous</A>
153
<A HREF="72Bargraphs.html">Next</A>
154
</BODY>
155
</HTML>