ofc_hbar.php 933 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. class hbar_value
  3. {
  4. function hbar_value( $left, $right=null )
  5. {
  6. if( isset( $right ) )
  7. {
  8. $this->left = $left;
  9. $this->right = $right;
  10. }
  11. else
  12. $this->right = $left;
  13. }
  14. function set_colour( $colour )
  15. {
  16. $this->colour = $colour;
  17. }
  18. function set_tooltip( $tip )
  19. {
  20. $this->tip = $tip;
  21. }
  22. }
  23. class hbar
  24. {
  25. function hbar( $colour )
  26. {
  27. $this->type = "hbar";
  28. $this->values = array();
  29. $this->set_colour( $colour );
  30. }
  31. function append_value( $v )
  32. {
  33. $this->values[] = $v;
  34. }
  35. function set_values( $v )
  36. {
  37. foreach( $v as $val )
  38. $this->append_value( new hbar_value( $val ) );
  39. }
  40. function set_colour( $colour )
  41. {
  42. $this->colour = $colour;
  43. }
  44. function set_key( $text, $size )
  45. {
  46. $this->text = $text;
  47. $tmp = 'font-size';
  48. $this->$tmp = $size;
  49. }
  50. function set_tooltip( $tip )
  51. {
  52. $this->tip = $tip;
  53. }
  54. }