Chart


The Chart script command both creates a new chart or adds new data to an existing chart. One or two variable strip charts are created, with new data points appearing on the right, while prior charted data moves left.

New data is added to the chart every time the chart script command is executed, but a new data point is only added to the chart when the duration since the last data point has been exceeded, and all old data points are moved appropriately to the left. As such, it is necessary that the time between executing the chart script command be slightly less than the designated seconds per data point for a continuous chart.

For MaxValue or AvgValue charts, the choice determines what will be the displayed data point when multiple data values are charted for each data point. This is only a concern for longer term charts, where ChartSeconds is much larger than the time between Chart script command executions.

For example, setting ChartSeconds to 10 requires executing the chart script command at least every 10 seconds, and makes a 4000 second long chart, a bit longer than an hour. With typically only a single data value per data point, MaxValue and AvgValue produce identical charts.

On the other hand, setting ChartSeconds to 100 makes a 40,000 second long chart, which is better than 10 hours. Called at the same interval (every 10 seconds) then about 10 data points are accumulated for each charted data point ... such that MaxValue and AvgValue produce very different charts.

Setting ChartSeconds to 500 will display a 2 day history, and setting ChartSeconds to 2000 will display a 10 day history. For any desired interval, simply set ChartSeconds to the desired time span / 400, as each chart is 400 data points long.

The time scale on the strip chart is automatically marked by minute, hour, or day of month, as appropriate to the seconds assigned to each data point.

Syntax: Chart Expression , Expression Comment
Example: Chart Well , Booster Chart a pair of user defined variables to the current LogFilename


Associated command may be bound to Chart to define the chart name

Example: Assign LogFilename = "Amps last hour" Associated command to define the chart name
Chart Well , Booster Chart to Amps last hour


Associated commands may be bound to Chart to completely define the chart creation should it not exist.

However, once a chart is created, these parameters do not ALTER initial defined chart parameters. This means, once a chart has been created by a script, editing the script will not alter the chart's parameters ... they're permenantly saved in the chart's data file. To redefine an existing chart, either delete the prior chart data file or give the new chart a diferent name.

Example: Assign LogFilename = "Amps Last 10 hrs" Associated command to define the chart name
Assign ChartSeconds = 100 Associated command to set the number of seconds per data point
Assign ChartType1 = MaxValue Associated command to set the type for variable 1
Assign ChartType2 = MaxValue Associated command to set the type for variable 2
Assign ChartLegend1 = Well Associated command to set the legend for variable 1
Assign ChartLegend2 = Booster Associated command to set the legend for variable 2
Assign ChartAutoscale1 = 25 Associated command to set the autoscale for variable 1
Assign ChartAutoscale2 = 25 Associated command to set the autoscale for variable 2
Chart Well , Booster Chart to Amps last hour

Example Chart

Notes:


© 2014 ComroeStudios LLC. All Rights Reserved.