Jump to content

Component: GLCD Graph Creator (Graphical Library): Difference between revisions

From Flowcode Help
No edit summary
No edit summary
Line 16: Line 16:


==Detailed description==
==Detailed description==




Line 24: Line 26:


==Examples==
==Examples==




Line 70: Line 74:
| colspan="2" |  
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:]] -  
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | Erase
| width="90%" | Erase
|-
|-
Line 88: Line 92:
|-
|-
|-
|-
| width="10%" align="center" | [[File:]] -  
| width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
| width="90%" | Data
| width="90%" | Data
|-
|-

Revision as of 13:32, 17 November 2021

Author Matrix TSL
Version 1.2
Category Graphical Library


GLCD Graph Creator component

A component to simplify the process of drawing graphs and charts using a graphical LCD.

Detailed description

No detailed description exists yet for this component

Examples

The graph creator component must be linked to the graphical LCD using the gLCD Object property.



The X Coord, Y Coord, Width and Height component properties set the size and position of the graph on the gLCD.


In the attached example the ADC component sets the input to the graph. Every 50ms a sample is taken and added to the graph.


Graph Creator Demo



Any size of graph can be created. For efficiency it is best to try and stick to the following rules.

  • The width should be equal to or a multiple of the number of points
  • The height should be equal to or a division of the input range - Min Value 0 to Max Value 255 = input range of 256
  • If Show Border is enabled then Width and Height should be as above plus 2 to account for the border pixels

Downloadable macro reference

ExportToCSV
Exports the data in the graph to a CSV file. 
- STRING Filename
 
- BOOL Erase
0=Append to the end of existing data, 1=Erase any existing data 
- VOID Return


AddPoint
Adds a new data point to the graph. 
- INT Data
Data Value to plot 
- BYTE Index
Plot Index: Range 0-7 
- VOID Return


Initialise
Initialises the graph object on the GLCD to the specified dimensions. 
- VOID Return



Property reference

Properties
gLCD Object
Graphical LCD Object to draw the graph on 
ColourDisplay
Automatically detects if the graphical LCD object is colour or monochrome 
X Coord
X coordinate for the top left of the graph container rectangle 
Y Coord
Y coordinate for the top left of the graph container rectangle 
Width
Horizontal size of the graph in pixels 
Height
Vertical size of the graph in pixels 
Number Of Plots
Determines the number of plots that can be displayed simultaneously on the graph. Monochrome displays can only support a single plot. 
Number Of Points
Number of data points the graph can store, multiplied by the number of plots. 
Scrolling
Controls how data is drawn onto the display. Scrolling is useful for slower data where you want a constant plot with the right hand side always being the latest data. None scrolling is useful for faster data such as audio snippets. 
Graph Style
Controls the graph draw style. Point - Draws a single point Line - Draws a line from the last point to the new point 
Min Value
Value to represent the bottom Y axis on the graph 
Max Value
Value to represent the top Y axis on the graph 
Show Border
Decides if a border for the graph is generated 
Show Grid
Decides if a X or Y grid is shown for the graph 
Background Colour
Determines the graph background colour.  
Plot 0 Colour
Determines the graph plot colour.  
Connections
Simulations