Graph widget.
-
set_background_color (color)
-
Fill all the widget (width * height) with this color (default is none ).
Parameters:
- color
a string "#rrggbbaa" or "#rrggbb"
Usage:
mygraph:set_background_color(string) -->"#rrggbbaa"
-
set_graph_background_color (color)
-
Fill the graph area background with this color (default is none).
Parameters:
- color
a string "#rrggbbaa" or "#rrggbb"
Usage:
mygraph:set_graph_background_color(string) -->"#rrggbbaa"
-
set_rounded_size (rounded_size)
-
Set rounded corners for background and graph background.
Parameters:
- rounded_size
float in [0,1]
Usage:
mygraph:set_rounded_size(a) -> a in [0,1]
-
set_v_margin (margin)
-
Define the top and bottom margin for the graph area.
Parameters:
- margin
an integer for top and bottom margin
Usage:
mygraph:set_v_margin(integer)
-
set_h_margin (margin)
-
Define the left and right margin for the graph area.
Parameters:
- margin
an integer for left and right margin
Usage:
mygraph:set_h_margin(integer)
-
set_graph_color (color)
-
Define the graph color.
Parameters:
- color
a string "#rrggbbaa" or "#rrggbb"
Usage:
mygraph:set_graph_color(string) -->"#rrggbbaa"
-
set_graph_line_color (color)
-
Define the graph outline.
Parameters:
- color
a string "#rrggbbaa" or "#rrggbb"
Usage:
mygraph:set_graph_line_color(string) -->"#rrggbbaa"
-
set_show_text (boolean)
-
Display text on the graph or not.
Parameters:
- boolean
true or false (default is false)
Usage:
mygraph:set_show_text(boolean) --> true or false
-
set_text_color (color)
-
Define the color of the text.
Parameters:
- color
a string "#rrggbbaa" or "#rrggbb" defaul is white
Usage:
mygraph:set_text_color(string) -->"#rrggbbaa"
-
set_text_background_color (color)
-
Define the background color of the text.
Parameters:
- color
a string "#rrggbbaa" or "#rrggbb"
Usage:
mygraph:set_text_background_color(string) -->"#rrggbbaa"
-
set_font (font)
-
Define the text's font .
Parameters:
- font
a string that contains the font name family and weight
Usage:
mygraph:set_font(string)
-
set_font_size (size)
-
Define the text font size.
Parameters:
Usage:
mygraph:set_font_size(integer)
-
set_label (text)
-
Define the template of the text to display.
Parameters:
Usage:
mygraph:set_label(string)
By default the text is : (value_send_to_the_widget *100) .. "%"
static string: example set_label("CPU usage:") will display "CUP usage:" on the graph
dynamic string: use $percent in the string example set_label("Load $percent %") will display "Load 10%"
-
set_height (height)
-
Set the graph height.
Parameters:
- height
The height to set.
-
set_width (width)
-
Set the graph width.
Parameters:
-
new (args)
-
Create a graph widget.
Parameters:
- args
Standard widget() arguments. You should add width and height
key to set graph geometry.
Returns:
A graph widget.