latest method

VlChartMark latest()

The mark added last, for a caller that built one and let go of it.

A chart with no marks answers a mark belonging to nothing and reports it in errors, rather than quietly adding a point nobody asked for.

Returns The last mark added.

Implementation

VlChartMark latest() {
  int n = marks.length;
  if ( n > 0 ) {
    return marks[(n - 1)];
  }
  this.error("the chart has no marks, so there is no last one");
  VlChartMark loose =  VlChartMark();
  loose.owner = this;
  return loose;
}