# Module `blingbling.linegraph`

Graph widget.

## Functions

set_background_color (color) | Fill all the widget (width * height) with this color (default is none ).
set_graph_background_color (color) | Fill the graph area background with this color (default is none).
set_rounded_size (rounded_size) | Set rounded corners for background and graph background.
set_v_margin (margin) | Define the top and bottom margin for the graph area.
set_h_margin (margin) | Define the left and right margin for the graph area.
set_graph_color (color) | Define the graph color.
set_graph_line_color (color) | Define the graph outline.
set_show_text (boolean) | Display text on the graph or not.
set_text_color (color) | Define the color of the text.
set_text_background_color (color) | Define the background color of the text.
set_font (font) | Define the text's font .
set_font_size (size) | Define the text font size.
set_label (text) | Define the template of the text to display.
set_height (height) | Set the graph height.
set_width (width) | Set the graph width.
new (args) | Create a graph widget.

## Local Functions

add_value (graph, value, group) | Add a value to the graph.

## Functions

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:

  - size the font size

  ### Usage:

      mygraph:set_font_size(integer)

set_label (text)
  Define the template of the text to display.

  ### Parameters:

  - text the text to display

  ### 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:

  - width The width to set.
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.

## Local Functions

add_value (graph, value, group)
  Add a value to the graph. For compatibility between old and new awesome widget, add_value can be replaced by set_value

  ### Parameters:

  - graph the graph
  - value The value between 0 and 1.
  - group The stack color group index.

  ### Usage:

      mygraph:add_value(a) or mygraph:set_value(a)

generated by LDoc 1.4.2