| 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="921Timingthegenerationofgraphs.html">
|
|
|
8 |
<LINK REL="Next" HREF="923Addingiconsontothegraph.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="921Timingthegenerationofgraphs.html">Previous</A>
|
|
|
26 |
<A HREF="923Addingiconsontothegraph.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H2><A NAME="9_22">9.22 Using country flags in various context</A></H2>
|
|
|
29 |
<P> JpGraph has built-in support for over 200 country flags, i.e. they
|
|
|
30 |
are available to be used in graphs without any external image
|
|
|
31 |
definitions.</P>
|
|
|
32 |
<P> Country flags can be used in primarily two settings</P>
|
|
|
33 |
<OL>
|
|
|
34 |
<LI> As image markers in line and scatter graphs</LI>
|
|
|
35 |
<LI> As background images for graphs</LI>
|
|
|
36 |
<LI> As a special type of icons (using the IconPlot()) which can be
|
|
|
37 |
added to the graph in any arbitrary position. See next section</LI>
|
|
|
38 |
</OL>
|
|
|
39 |
<P> In order to make it easy to find the appropriate country flags they
|
|
|
40 |
can be specified with either full or partial name or as an numeric
|
|
|
41 |
index. The routines in JpGraph are "smart" enough to figure out which
|
|
|
42 |
way you are trying to specify a particular flag.</P>
|
|
|
43 |
<P> To specify a country flag as a marker you have to specify the
|
|
|
44 |
special mark type as one of MARK_FLAG1,MARK_FLAG2,MARK_FLAG3 or
|
|
|
45 |
MARK_FLAG4</P>
|
|
|
46 |
<P> Flags are internally stored in 4 different sizes which is indicated
|
|
|
47 |
by the number in the mark types. Flags may also be arbitrary scaled
|
|
|
48 |
when displayed. Since this is partially overlapping functionality you
|
|
|
49 |
might very well ask why the flags are stored in four different basic
|
|
|
50 |
sizes. The reason is of course performance. It you only want a very
|
|
|
51 |
small flag it takes processing time to scale down a large image to,
|
|
|
52 |
say, a small icon size. At the same time for large flags to be used as
|
|
|
53 |
background a small original flag might not have enough details to be
|
|
|
54 |
scaled up to a large size. Hence the reason for storing the flags in 4
|
|
|
55 |
different sizes.</P>
|
|
|
56 |
<P> The example below shows how to use country flags as markers<DIV class="example">
|
|
|
57 |
<BR> <A href="exframes/frame_markflagex1.html" target="blank"><IMG border="0"
|
|
|
58 |
HEIGHT="200" src="img/img/img/img/img/img/markflagex1.png" WIDTH="300"></A>
|
|
|
59 |
<BR><B>Figure 183:</B> Using country flags as line plot markers <A href="exframes/frame_markflagex1.html"
|
|
|
60 |
target="blank">[src]</A>
|
|
|
61 |
<P></P>
|
|
|
62 |
</DIV></P>
|
|
|
63 |
<P> To use country flags as background one has to use the method
|
|
|
64 |
Graph::SetBackgroundCountryFlag(). With this method you can specify
|
|
|
65 |
both how much of the image should be filled as well as how much of the
|
|
|
66 |
flag should be mixed into the background.</P>
|
|
|
67 |
<P> To see a list of all supported country flags you can run the script
|
|
|
68 |
"listallcountryflags.php" in the Example directory. This will show you
|
|
|
69 |
a table with all flags.</P>
|
|
|
70 |
<HR NOSHADE>
|
|
|
71 |
<A HREF="toc.html">Contents</A>
|
|
|
72 |
<A HREF="921Timingthegenerationofgraphs.html">Previous</A>
|
|
|
73 |
<A HREF="923Addingiconsontothegraph.html">Next</A>
|
|
|
74 |
</BODY>
|
|
|
75 |
</HTML>
|