Series

The series type represents a single line on a Chart. It does not have a constructor, but can be created using the chart.new_series method.

Methods

  • void plot(float x, float y): plot a point by it's coordinates
  • void plot(complex pt): plot a point by it's coordinates packed into a complex number
  • void plot(float[] xs, float[] ys): plot many points by their coordinates
  • void plot(complex[] pts): plot many points by their coordinates packed into complex numbers

Performance

Each call to plot causes the whole graph to be redrawn, therefore batch updating is significantly more efficient, however being harder to use because it requires a storage for points.

The single-point overloads are good for drawing the graph in real time. If the drawing gets jaggy, a io:wait 5 after each call to plot helps a lot.

Last edited Mar 17, 2011 at 9:59 PM by impworks, version 2

Comments

No comments yet.