ofc_scatter.php 772 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. class scatter_value
  3. {
  4. function scatter_value( $x, $y, $dot_size=-1 )
  5. {
  6. $this->x = $x;
  7. $this->y = $y;
  8. if( $dot_size > 0 )
  9. {
  10. $tmp = 'dot-size';
  11. $this->$tmp = $dot_size;
  12. }
  13. }
  14. }
  15. class scatter
  16. {
  17. function scatter( $colour )
  18. {
  19. $this->type = "scatter";
  20. $this->set_colour( $colour );
  21. }
  22. function set_colour( $colour )
  23. {
  24. $this->colour = $colour;
  25. }
  26. function set_default_dot_style( $style )
  27. {
  28. $tmp = 'dot-style';
  29. $this->$tmp = $style;
  30. }
  31. /**
  32. * @param $v as array, can contain any combination of:
  33. * - integer, Y position of the point
  34. * - any class that inherits from scatter_value
  35. * - <b>null</b>
  36. */
  37. function set_values( $values )
  38. {
  39. $this->values = $values;
  40. }
  41. }