ofc_x_axis_labels.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. class x_axis_labels
  3. {
  4. function x_axis_labels(){}
  5. /**
  6. * @param $steps which labels are generated
  7. */
  8. function set_steps( $steps )
  9. {
  10. $this->steps = $steps;
  11. }
  12. /**
  13. * @param $steps as integer which labels are visible
  14. */
  15. function visible_steps( $steps )
  16. {
  17. $this->{"visible-steps"} = $steps;
  18. return $this;
  19. }
  20. /**
  21. *
  22. * @param $labels as an array of [x_axis_label or string]
  23. */
  24. function set_labels( $labels )
  25. {
  26. $this->labels = $labels;
  27. }
  28. function set_colour( $colour )
  29. {
  30. $this->colour = $colour;
  31. }
  32. /**
  33. * font size in pixels
  34. */
  35. function set_size( $size )
  36. {
  37. $this->size = $size;
  38. }
  39. /**
  40. * rotate labels
  41. */
  42. function set_vertical()
  43. {
  44. $this->rotate = 270;
  45. }
  46. /**
  47. * @param @angle as real. The angle of the text.
  48. */
  49. function rotate( $angle )
  50. {
  51. $this->rotate = $angle;
  52. }
  53. /**
  54. * @param $text as string. Replace and magic variables with actual x axis position.
  55. */
  56. function text( $text )
  57. {
  58. $this->text = $text;
  59. }
  60. }