ofc_line_base.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. class line_base
  3. {
  4. function line_base()
  5. {
  6. $this->type = "line";
  7. $this->text = "Page views";
  8. $tmp = 'font-size';
  9. $this->$tmp = 10;
  10. $this->values = array();
  11. }
  12. function set_values( $v )
  13. {
  14. $this->values = $v;
  15. }
  16. /**
  17. * Append a value to the line.
  18. *
  19. * @param mixed $v
  20. */
  21. function append_value($v)
  22. {
  23. $this->values[] = $v;
  24. }
  25. function set_width( $width )
  26. {
  27. $this->width = $width;
  28. }
  29. function set_colour( $colour )
  30. {
  31. $this->colour = $colour;
  32. }
  33. function set_dot_size( $size )
  34. {
  35. $tmp = 'dot-size';
  36. $this->$tmp = $size;
  37. }
  38. function set_halo_size( $size )
  39. {
  40. $tmp = 'halo-size';
  41. $this->$tmp = $size;
  42. }
  43. function set_key( $text, $font_size )
  44. {
  45. $this->text = $text;
  46. $tmp = 'font-size';
  47. $this->$tmp = $font_size;
  48. }
  49. function set_tooltip( $tip )
  50. {
  51. $this->tip = $tip;
  52. }
  53. function set_on_click( $text )
  54. {
  55. $tmp = 'on-click';
  56. $this->$tmp = $text;
  57. }
  58. function loop()
  59. {
  60. $this->loop = true;
  61. }
  62. function line_style( $s )
  63. {
  64. $tmp = "line-style";
  65. $this->$tmp = $s;
  66. }
  67. /**
  68. * Sets the text for the line.
  69. *
  70. * @param string $text
  71. */
  72. function set_text($text)
  73. {
  74. $this->text = $text;
  75. }
  76. }