Added a graphing functionality with Open Flash Chart, and added ability to graph...
[openemr.git] / library / openflashchart / php-ofc-library / ofc_bar_base.php
blobc1303b86bb93f7bd3a9c72faa83fcb1f114f2e1c
1 <?php
3 /* this is a base class */
5 class bar_base
7 function bar_base(){}
9 /**
10 * @param $text as string the key text
11 * @param $size as integer, size in pixels
13 function set_key( $text, $size )
15 $this->text = $text;
16 $tmp = 'font-size';
17 $this->$tmp = $size;
20 /**
21 * syntatical sugar.
23 function key( $text, $size )
25 $this->set_key( $text, $size );
28 /**
29 * @param $v as an array, a mix of:
30 * - a bar_value class. You can use this to customise the paramters of each bar.
31 * - integer. This is the Y position of the top of the bar.
33 function set_values( $v )
35 $this->values = $v;
38 /**
39 * see set_values
41 function append_value( $v )
43 $this->values[] = $v;
46 /**
47 * @param $colour as string, a HEX colour, e.g. '#ff0000' red
49 function set_colour( $colour )
51 $this->colour = $colour;
54 /**
55 *syntatical sugar
57 function colour( $colour )
59 $this->set_colour( $colour );
62 /**
63 * @param $alpha as real number (range 0 to 1), e.g. 0.5 is half transparent
65 function set_alpha( $alpha )
67 $this->alpha = $alpha;
70 /**
71 * @param $tip as string, the tip to show. May contain various magic variables.
73 function set_tooltip( $tip )
75 $this->tip = $tip;
78 /**
79 *@param $on_show as line_on_show object
81 function set_on_show($on_show)
83 $this->{'on-show'} = $on_show;
86 function set_on_click( $text )
88 $tmp = 'on-click';
89 $this->$tmp = $text;
92 function attach_to_right_y_axis()
94 $this->axis = 'right';