Plot

The plot object permits to display on the panel a figure that graphically shows the trend of a variable. This object automatically collects values of X and Y and add the corresponding points to the Plot. This object can automatically select the best scale to show the figure, or automatically generate the X values in case the sequence of x values is incremental by 1. If required, the user can manually specify both the ranges for the scales and the number of grid divisions.

1. Object definition

 Syntax

A plot can be added to the panel using the following syntax:

G
ID [type] stylers [events] : [xmin,xmax,ymin,ymax,xdiv,ydiv] : title : label_x : label_y : track_col :
title_col : axes_col : grid_col : back_col ;

The fields between brackets [ ] are optional.

The following table describes in detail the meaning of each field.

 
Field Lenght Description
Values
G
1 char
the char that defines the plot object G
ID 1 char
unique ID to identify the plot on the panel. This field can be only 0 0
[type] 1 char

This field is optional and can be:

"A" : the x values are automatically generated. Only y values required.
-
stylers variabile

The styler "%" (dimension) is mandatory for the plot.

The optional styler "*" (size) is helpfull to adjust the dimiension of text labels.

You can add more styler that define the graphical appearance of the Plot (such as size, position, opacity, border, background...)

Some stylers may not take effect because meaningless for this object.
see stylers
[events]
One or more event specifiers see events
 xmin to ydiv  variable These are optional parameters that define the axis limits and the number of divisions of the grid. Each parameter is separated by a comma (,). Parameters can be left empty.

xmin defines the x-axis minimum value
xmax define the x-axis maximum value
ymin defines the y-axis minimum value
ymax defines the y-axis maximum value
xdiv defines the number of vertical grid divisions
ydiv defines the number of horizontal grid division

If axis limits are not specified or omitted, the plot will use the autoscale function.
 
title
variabile
Title text
ASCII characters except ":" and ";"
label_x
 variabile
x-axis text

label_y
 variabile
y-axis text

track_col
3 chars
Color of the curve.
(12-bit RGB hexadecimal format, i.e red=F00).
3 chars HEX
title_col
3 chars
Color of the title
3 chars HEX
axes_col
3 chars
Color of the axes
3 chars HEX
grid_col
3 chars
Color of the grid
3 chars HEX
back_col 
3 chars
Color of the background
3 chars HEX

   


Example


Example 1

Task:

Panel with a external dimension of 100x50 (with respect the horizontal dimension of the display) and a specified proportion between text and plot.
Different colors for data line, title, axes, grid and background.




Definition:

object: G

ID: 0

[type]: -

stylers: %100,50*15

title: Thermometer

label_x: Sample

label_y: Degree

track_col: F00

title_col: 000

axex_col: 00F

grid_col:EEE

back_col:FFF

Panel:

G0%100,50*15:0,100,0,50,10,5:
Thermometer:Sample:Degree:
F00:000:00F:EEE:FFF;

 

http://www.miupanel.com/Portals/0/custom_images/plot1.JPG

   

 


2. Object Usage


You can insert new points to your plot, add points to those already present or clear the plot.
The syntax to do these things, depends from the "type" of plot you have defined.

1. Plot defined without any "type" specification
  • Clear the plot & insert new points  (Controller --> WiFi Module --> Panel screen)

Syntax

#G0C
: x1, y1, x2, y2, x3, y3, .... ;

The character "C" in the mnemonic code, specifies the "clear" operation before to plot the new point (x,y).  

Example:

Clear the plot and print the new points (4,5), (6,8), (9,15): #G0C:4,5,6,8,9,15;

 

  • Add points to plot  (Controller --> WiFi Module --> Panel screen)

Syntax

#G0P
: x1, y1, x2, y2, x3, y3, .... ;

The character "P" in the mnemonic code, specifies the "plot" operation without clear the plot.  

Example:

Add to plot the points (4,5), (6,8), (9,15): #G0P:4,5,6,8,9,15;

 


2. Plot defined as type = "A"

  • Clear the plot & insert new points (Controller --> WiFi Module --> Panel screen)

Syntax

#G0C
: y1, y2, y3, .... ;

The character "C" in the mnemonic code, specifies the "clear" operation before to plot the new point (x,y).  

Example:

Clear the plot and print the new points having y1=3, y2=6, y3=4 and default increments for xi#G0C:3,6,4;

 

  • Add points to plot (Controller --> WiFi Module --> Panel screen)

Syntax

#G0P
: y1, y2, y3, .... ;

The character "P" in the mnemonic code, specifies the "plot" operation without clear the plot.  

Example:

Add to plot the points having y1=3, y2=6, y3=4 and default increments for xi : #G0P:3,6,4;

 

 

Events (Panel ---> WiFi Module ---> Controller)

Read the events section to learn how to enable and manage the events for this object.