source: code/Website/php-ofc-library/ofc_hbar.php@ 7937

Last change on this file since 7937 was 7849, checked in by dennisw, 15 years ago
File size: 933 bytes
Line 
1<?php
2
3class hbar_value
4{
5 function hbar_value( $left, $right=null )
6 {
7 if( isset( $right ) )
8 {
9 $this->left = $left;
10 $this->right = $right;
11 }
12 else
13 $this->right = $left;
14 }
15
16 function set_colour( $colour )
17 {
18 $this->colour = $colour;
19 }
20
21 function set_tooltip( $tip )
22 {
23 $this->tip = $tip;
24 }
25}
26
27class hbar
28{
29 function hbar( $colour )
30 {
31 $this->type = "hbar";
32 $this->values = array();
33 $this->set_colour( $colour );
34 }
35
36 function append_value( $v )
37 {
38 $this->values[] = $v;
39 }
40
41 function set_values( $v )
42 {
43 foreach( $v as $val )
44 $this->append_value( new hbar_value( $val ) );
45 }
46
47 function set_colour( $colour )
48 {
49 $this->colour = $colour;
50 }
51
52 function set_key( $text, $size )
53 {
54 $this->text = $text;
55 $tmp = 'font-size';
56 $this->$tmp = $size;
57 }
58
59 function set_tooltip( $tip )
60 {
61 $this->tip = $tip;
62 }
63}
64
Note: See TracBrowser for help on using the repository browser.