Added a graphing functionality with Open Flash Chart, and added ability to graph...
[openemr.git] / library / openflashchart / php-ofc-library / ofc_x_axis.php
blobda1c7672bda03081e161ebc2949b9c5d83476e76
1 <?php
3 class x_axis
5 function x_axis(){}
7 /**
8 * @param $stroke as integer, with of the line and ticks
9 */
10 function set_stroke( $stroke )
12 $this->stroke = $stroke;
15 function stroke( $stroke )
17 $this->set_stroke( $stroke );
18 return $this;
21 /**
22 *@param $colour as string HEX colour
23 *@param $grid_colour as string HEX colour
25 function set_colours( $colour, $grid_colour )
27 $this->set_colour( $colour );
28 $this->set_grid_colour( $grid_colour );
31 /**
32 *@param $colour as string HEX colour
34 function set_colour( $colour )
36 $this->colour = $colour;
39 function colour( $colour )
41 $this->set_colour($colour);
42 return $this;
45 function set_tick_height( $height )
47 $tmp = 'tick-height';
48 $this->$tmp = $height;
51 function tick_height( $height )
53 $this->set_tick_height($height);
54 return $this;
57 function set_grid_colour( $colour )
59 $tmp = 'grid-colour';
60 $this->$tmp = $colour;
63 function grid_colour( $colour )
65 $this->set_grid_colour($colour);
66 return $this;
69 /**
70 * @param $o is a boolean. If true, the X axis start half a step in
71 * This defaults to True
73 function set_offset( $o )
75 $this->offset = $o?true:false;
78 function offset( $o )
80 $this->set_offset($o);
81 return $this;
84 /**
85 * @param $steps as integer. Which grid lines and ticks are visible.
87 function set_steps( $steps )
89 $this->steps = $steps;
92 function steps( $steps )
94 $this->set_steps($steps);
95 return $this;
98 /**
99 * @param $val as an integer, the height in pixels of the 3D bar. Mostly
100 * used for the 3D bar chart.
102 function set_3d( $val )
104 $tmp = '3d';
105 $this->$tmp = $val;
109 * @param $x_axis_labels as an x_axis_labels object
110 * Use this to customize the labels (colour, font, etc...)
112 function set_labels( $x_axis_labels )
114 //$this->labels = $v;
115 $this->labels = $x_axis_labels;
119 * Sugar syntax: helper function to make the examples simpler.
120 * @param $a is an array of labels
122 function set_labels_from_array( $a )
124 $x_axis_labels = new x_axis_labels();
125 $x_axis_labels->set_labels( $a );
126 $this->labels = $x_axis_labels;
128 if( isset( $this->steps ) )
129 $x_axis_labels->set_steps( $this->steps );
133 * min and max.
135 function set_range( $min, $max )
137 $this->min = $min;
138 $this->max = $max;