The TimePlot class provides a convenient set of methods for setting properties and sending data to the MegunoLink Pro Time Plot visualizer.

To use the Time Plot functions:

  1. Install the MegunoLink Pro Arduino library
  2. Add #include "MegunoLink.h" to the top of your Arduino program
  3. Create a TimePlot variable
  4. Call methods on the TimePlot variable

Example

This example sends the current voltage on analog channel 0 to MegunoLink Pro every 200 ms.

Description

The TimePlot shows numerical data on a graph with time as the x-axis. Data sent with the library uses the computer’s time when the message is received. Custom time strings can be sent using the raw message format.

Multiple plots are supported using channels. Each plot visualizer in MegunoLink Pro shows the series for one channel. The channel used when sending commands is specified in the TimePlot constructor. Channels are optional. If not specified, the default channel is used and all data will appear on any plot that doesn’t have a specific channel selected.

Data is collected together in series for plotting with new values appended as it arises. Series names are used to identify each collection of data and to set the line and marker styles for plotting.

Methods

TimePlot(ChannelName — optional ) (constructor)
SendData(SeriesName, YValue, SeriesProperties — optional )
SendData(SeriesName, YValue, Color, LineStyle, LineWidth, MarkerStyle)
SendFloatData(SeriesName, YValue, DecimalPlaces, SeriesProperties — optional )
SendFloatData(SeriesName, YValue, DecimalPlaces, Color, LineStyle, LineWidth, MarkerStyle)
SetTitle(Title)
SetXLabel(Label)
SetYLabel(Label)
SetSeriesProperties(SeriesName, Color, LineStyle, LineWidth, MarkerStyle)
SetSeriesProperties(SeriesName, SeriesProperties)
Clear()
Clear(SeriesName)

Style Types

Colors = { Red, Green, Blue, Yellow, Black, Magenta, Cyan, White }
LineStyle = { Solid, Dashed, Dotted, DashDot, DashDotDot, NoLine }
MarkerStyle = { Square, Diamond, Triangle, Circle, Cross, Plus, Star, DownwardTriangle, NoMarker }

Detailed Descriptions

TimePlot(ChannelName — optional )

Constructs a time plot variable, with an optional ChannelName.

SendData(SeriesName, YValue, SeriesProperties — optional )

Send the YValue, a number, to MegunoLink Pro where it will be added to the series SeriesName. A series property string may be specified to set the series style.

SendData(SeriesName, YValue, Color, LineStyle, LineWidth, MarkerStyle)

Send the YValue, a number, to MegunoLink Pro where it will be added to the series SeriesName. Also sets the color, line-style, line-width and marker style used for plotting.

SendFloatData(SeriesName, YValue, DecimalPlaces, SeriesProperties — optional )

Send the YValue, a floating point number, to MegunoLink Pro where it will be added to the series SeriesName. DecimalPlaces sets the number of decimal places to use when the data is sent. A series property string may be specified to set the series style.

SendFloatData(SeriesName, YValue, DecimalPlaces, Color, LineStyle, LineWidth, MarkerStyle)

Send the YValue, a floating point number, to MegunoLink Pro where it will be added to the series SeriesName. DecimalPlaces sets the number of decimal places to use when the data is sent. Also sets the color, line-style, line-width and marker style used for plotting.

SetTitle(Title)

Sets the plot title.

SetXLabel(Label)

Sets the label displayed on the plot’s x-axis.

SetYLabel(Label)

Sets the label displayed on the plot’s y-axis.

SetSeriesProperties(SeriesName, Color, LineStyle, LineWidth, MarkerStyle)

Set the color, line-style, line-width and marker style used for plotting the given series.

SetSeriesProperties(SeriesName, SeriesProperties)

Sets one or more of the color, line-style, line-width and marker style used for plotting the given series with a series property string

Clear()

Clears all series from the plot.

Clear(SeriesName)

Clear the series named SeriesName from the plot

Recommended Posts
Showing 2 comments
  • jan
    Reply

    How do you clear a plot in Megunolink?

    • Philip Rowe
      Reply

      Hi Jan, just hit the second red cross button at the top of the plots toolbar. The first clears a selected series and the second clears all series.

      Cheers
      Phil

Leave a Comment

Contact Us

Send us an email and we will get back to you shortly.

Not readable? Change text. captcha txt

Start typing and press Enter to search