Reference

# Module `awful.widget.graph`

A graph widget.

Author:

Julien Danjou <julien@danjou.info>

Copyright© 2009 Julien Danjou

Release: v3.4.13

## Functions

add_value (graph, value, group) | Add a value to the graph
new (args) | Create a graph widget.
set_background_color (graph, color) | Set the graph background color.
set_border_color (graph, color) | Set the graph border color.
set_color (graph, color) | Set the graph foreground color.
set_gradient_angle (graph, gradient_angle) | Set the graph foreground colors gradient angle.
set_gradient_colors (graph, gradient_colors) | Set the graph foreground color as a gradient.
set_height (graph, height) | Set the graph height.
set_max_value (graph, value) | Set the maximum value the graph should handle.
set_scale (graph, scale) | Set the graph to automatically scale its values.
set_stack (graph, stack) | Set the graph to draw stacks.
set_stack_colors (graph, stack_colors) | Set the graph stacking colors.
set_width (graph, width) | Set the graph width.

## Functions

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

  ### Parameters

  - graph: The graph.
  - value: The value between 0 and 1.
  - group: The stack color group index.
new (args)
  Create a graph widget.

  ### Parameters

  - args: Standard widget() arguments. You should add width and height key to set graph geometry.

  ### Return value:

  A graph widget.
set_background_color (graph, color)
  Set the graph background color.

  ### Parameters

  - graph: The graph.
  - color: The graph background color.
set_border_color (graph, color)
  Set the graph border color. If the value is nil, no border will be drawn.

  ### Parameters

  - graph: The graph.
  - color: The border color to set.
set_color (graph, color)
  Set the graph foreground color.

  ### Parameters

  - graph: The graph.
  - color: The graph color.
set_gradient_angle (graph, gradient_angle)
  Set the graph foreground colors gradient angle. Default is 270 degrees (horizontal).

  ### Parameters

  - graph: The graph.
  - gradient_angle: Angle of gradient in degrees.
set_gradient_colors (graph, gradient_colors)
  Set the graph foreground color as a gradient.

  ### Parameters

  - graph: The graph.
  - gradient_colors: A table with gradients colors. The distance between each color can also be specified. Example: { "red", "blue" } or { "red", "green", "blue", blue = 10 } to specify blue distance from other colors.
set_height (graph, height)
  Set the graph height.

  ### Parameters

  - graph: The graph.
  - height: The height to set.
set_max_value (graph, value)
  Set the maximum value the graph should handle. If "scale" is also set, the graph never scales up below this value, but it automatically scales down to make all data fit.

  ### Parameters

  - graph: The graph.
  - value: The value.
set_scale (graph, scale)
  Set the graph to automatically scale its values. Default is false.

  ### Parameters

  - graph: The graph.
  - scale: A boolean value
set_stack (graph, stack)
  Set the graph to draw stacks. Default is false.

  ### Parameters

  - graph: The graph.
  - stack: A boolean value.
set_stack_colors (graph, stack_colors)
  Set the graph stacking colors. Order matters.

  ### Parameters

  - graph: The graph.
  - stack_colors: A table with stacking colors.
set_width (graph, width)
  Set the graph width.

  ### Parameters

  - graph: The graph.
  - width: The width to set.