minor bug fix
[openemr.git] / library / openflashchart / php-ofc-library / ofc_tags.php
blob7e7e2445423814429aa333dfaf05732d2fda6a55
1 <?php
3 class ofc_tags
5 function ofc_tags()
7 $this->type = "tags";
8 $this->values = array();
11 function colour( $colour )
13 $this->colour = $colour;
14 return $this;
17 /**
18 *@param $font as string. e.g. "Verdana"
19 *@param $size as integer. Size in px
21 function font($font, $size)
23 $this->font = $font;
24 $this->{'font-size'} = $size;
25 return $this;
28 /**
29 *@param $x as integer. Size of x padding in px
30 *@param $y as integer. Size of y padding in px
32 function padding($x, $y)
34 $this->{"pad-x"} = $x;
35 $this->{"pad-y"} = $y;
36 return $this;
39 function rotate($angle)
41 $this->rotate($angle);
42 return $this;
45 function align_x_center()
47 $this->{"align-x"} = "center";
48 return $this;
51 function align_x_left()
53 $this->{"align-x"} = "left";
54 return $this;
57 function align_x_right()
59 $this->{"align-x"} = "right";
60 return $this;
63 function align_y_above()
65 $this->{"align-y"} = "above";
66 return $this;
69 function align_y_below()
71 $this->{"align-y"} = "below";
72 return $this;
75 function align_y_center()
77 $this->{"align-y"} = "center";
78 return $this;
81 /**
82 * This can contain some HTML, e.g:
83 * - "More <a href="javascript:alert(12);">info</a>"
84 * - "<a href="http://teethgrinder.co.uk">ofc</a>"
86 function text($text)
88 $this->text = $text;
89 return $this;
92 /**
93 * This works, but to get the mouse pointer to change
94 * to a little hand you need to use "<a href="">stuff</a>"-- see text()
96 function on_click($on_click)
98 $this->{'on-click'} = $on_click;
99 return $this;
103 *@param $bold boolean.
104 *@param $underline boolean.
105 *@param $border boolean.
106 *@prarm $alpha real (0 to 1.0)
108 function style($bold, $underline, $border, $alpha )
110 $this->bold = $bold;
111 $this->border = $underline;
112 $this->underline = $border;
113 $this->alpha = $alpha;
114 return $this;
118 *@param $tag as ofc_tag
120 function append_tag($tag)
122 $this->values[] = $tag;
126 class ofc_tag extends ofc_tags
128 function ofc_tag($x, $y)
130 $this->x = $x;
131 $this->y = $y;