Data provider interface for the GraphView class.

This interface defines the DataSource for GraphView objects. The graph view queries an associated data source object for the data to display. All GraphView objects must have a data source object that hold the data to be displayed. The data source interface exposes an array-like scheme for providing data to the GraphView.

This interface forces you to expose your data sample as an array, where all samples has an index. The index starts at index 0 and has variable length.

You must subclass this interface and override at least 3 virtual methods. These 3 methods are:

By providing the methods for retreiving data, getting the total length of the data buffer and defining the valid value range of the data samples.

If your subclass is representing a casual signal buffer, where samples are continuesly written, you might override the method:

This method should return the index to the newest sample in the buffer. This enables the GraphView to display a scrolling cursor, that moves as the buffer data gets updates.

Note: You are in charge of notifying the associated GraphView‘s when the data source content changes.


Public Functions

virtual int mono::ui::IGraphViewDataSource::DataPoint(int index)
= 0

Override this to return data point samples to the view.

Provides a sample from the data source. You must override this method to return samples at any given index.

the sample value at the given index
  • index -

    The 0-indexed sample position, that should be returned

virtual int mono::ui::IGraphViewDataSource::BufferLength()
= 0

Override this to return the data sample buffer length to the view.

Returns the length / the total number of data samples in the data source. You must override this method to return the total number of data sample in your data source implementation.

the size / length of the data source

virtual int mono::ui::IGraphViewDataSource::MaxSampleValueSpan()
= 0

The value span for the data samples. üsed to map the buffer samples to the screen (view height)

virtual int mono::ui::IGraphViewDataSource::NewestSampleIndex()

Return the position / index of the newest sample in the buffer.

Override this method to get a scrolling pointer on the GraphView, a pointer that is drawn at this index position.

Position of newest sample