Thumbnail

Graphy

This is the graphy control for creating graphs and plotting data using the ControlCommand() commands.

+ How To Add This Control To Your Project (Click to Expand)
  1. Make sure you have the latest version of ARC installed.
  2. Select the Get button in this page to download the archive file.
  3. Double click the downloaded archive file to execute installer.
  4. The installer will add this control to ARC.
  5. Load ARC and press the Project -> Add Control button from the menu.
  6. Choose the Graphs category tab.
  7. Press the Graphy icon to add the control to your project.

Manual

The Graphy skill is used for creating graphs and plotting data using ControlCommand() scripts. Graph data can be saved as a .CSV file.

Main Window


User-inserted image


1. File Button
Save the Graph data to a .CSV file

2. Remove All Series Button
Clears all the graph data. 

3. Graph Window
Displays all the graph data.

4. Script
In order to use the Graphy skill a Script must be used to populate graph data.

How to Use the Graphy Skill


Add Data

Code:


ControlCommand("Graphy", AddData, SeriesName, YData)

Example: ControlCommand("Graphy", AddData, "Test Data", $value)

Adds data to the series name. If the series name doesn't exist, a series will be created with the specified name.

Add New Series

Code:


ControlCommand("Graphy", AddSeries, SeriesName, type)

Example: ControlCommand("Graphy", AddSeries, "Test Data", "line")

Adds a series to the chart with the specified name. The series chart type must be one of: Point, FastPoint, Bubble, Line, Spline, StepLine, FastLine, Bar, StackedBar, StackedBar100, Column, StackedColumn, StackedColumn100, Area, SplineArea, StackedArea, StackedArea100, Pie, Doughnut, Stock, Candlestick, Range, SplineRange, RangeBar, RangeColumn, Radar, Polar, ErrorBar, BoxPlot, Renko, ThreeLineBreak, Kagi, PointAndFigure, Funnel, Pyramid. Some types may return an error because they require only 1 series in the chart.

Change Series Type

Code:


ControlCommand("Graphy", ChangeSeriesType, SeriesName, type)

Example: ControlCommand("Graphy", ChangeSeriesType, "Test Data", "line")

Changes the series type of the chart with the specified name. The series chart type must be one of: Point, FastPoint, Bubble, Line, Spline, StepLine, FastLine, Bar, StackedBar, StackedBar100, Column, StackedColumn, StackedColumn100, Area, SplineArea, StackedArea, StackedArea100, Pie, Doughnut, Stock, Candlestick, Range, SplineRange, RangeBar, RangeColumn, Radar, Polar, ErrorBar, BoxPlot, Renko, ThreeLineBreak, Kagi, PointAndFigure, Funnel, Pyramid. Some types may return an error because they require only 1 series in the chart.

Reset All Chart Data

Code:


ControlCommand("Graphy", RemoveAllSeries)

Example: ControlCommand("Graphy", RemoveAllSeries)

Resets all the chart data for all series.

Remove Series Data

Code:


ControlCommand("Graphy", RemoveSeries, SeriesName)

Example: ControlCommand("Graphy", RemoveSeries, "Test Data")

Resets all the chart data for the specified series only.

Show Legend

Code:


ControlCommand("Graphy", ShowLegend, true/false)

Example: ControlCommand("Graphy", ShowLegend, true/false)

Enables/disables the legend. Use this if you require more screen real-estate by removing the legend.

Sample Code


This code will graph 3 servo positions while the servos are moving.

Code:

ControlCommand("Graphy", RemoveAllSeries)

:loop

$pos = getservo(d0)
ControlCommand("Graphy", AddData, "Servo D0", $pos)

$pos = getservo(d1)
ControlCommand("Graphy", AddData, "Servo D1", $pos)

$pos = getservo(d4)
ControlCommand("Graphy", AddData, "Servo D4", $pos)


sleep(250)

goto(loop)

Requirements


Variable data to plot to the graph.