Skip to content

Graph Renderer

Tobias Paczian edited this page Mar 29, 2018 · 2 revisions

image

Displays a graph of pie / bar charts with an optional legend.

options

  • type (STRING) - Defines the display type of the graph, can be one of [ pie, column, stackedColumn, row, stackedRow, line, stackedArea ]. Default is column.
  • title (STRING) - Title string written at the top of the graph.
  • title_color (CSS Color Value) - Color of the title text. Default is black.
  • title_settings (SVG settings object) - SVG settings for the title.
  • x_title (STRING) - Title written below the x-axis.
  • y_title (STRING) - Title written to the left of the y-axis.
  • x_title_color (CSS Color Value) - Color of the x-axis title string. Default is black.
  • y_title_color (CSS Color Value) - Color of the y-axis title string. Default is black.
  • x_labels (ARRAY of STRING) - List of the labels at the ticks of the x-axis.
  • x_labels_rotation (STRING) - A string representing the number of degrees to rotate the labels on the x-axis. Default is 0.
  • y_labels (ARRAY of STRING) - List of the labels at the ticks of the y-axis. If no list is passed will use the y-values.
  • x_tick_interval (INT) - Determines how many ticks are actually drawn on the x-axis. Default is 0.
  • y_tick_interval (INT) - Determines how many ticks are actually drawn on the y-axis. Default is 30.
  • x_labeled_tick_interval (INT) - Determines which ticks on the x-axis get labels. Default is 1.
  • y_labeled_tick_interval (INT) - The number of y-axis ticks that get labels. Default is 5.
  • default_line_color (CSS Color Value) - Determines the color of lines if not specified for an individual line. Default is black.
  • default_line_width (INT) - Number of pixels lines should be wide if not specified for an individual line. Default is 1.
  • show_legend (BOOLEAN) - Turns the display of the legend on / off. Default is true.
  • legend_position (STRING) - Can be one of [ left, right, top, bottom ]
  • chartArea (ARRAY of FLOAT) - The values passed correspond to the left, top, width and height of the chart area respectively. The position is relative to the top left corner of the containing div. Values less than 1 are interpreted as fractions. Values greater than 1 are interpreted as absolute pixel values. Note that the labels are drawn to the left and bottom of these margins.
  • legendArea (ARRAY of FLOAT) - If this parameter is set, the legend_position parameter will not be used. Instead pass an array of floats. The values correspond to the left, top, width and height of the legend area respectively. The position is relative to the top left corner of the containing div. Values less than 1 are interpreted as fractions. Values greater than 1 are interpreted as absolute pixel values.
  • width (INT) - The width of the graph in pixel (including legend).
  • height (INT) - The height of the graph in pixel (including legend).
  • data (ARRAY of OBJECT) - List of data series. Each series has a name and a data attribute. The data attribute is a list of y-values for the series.
  • onclick (FUNCTION) - The passed function will be called when a bar / pie slice is clicked. It will receive an object with the attributes
    • series - the name of the series this bar belongs to
    • value - the value of the bar
    • label - the label of the bar
    • item - the svg element that was clicked
    • index - the zero based index of this bar within its series
    • series_index - the zero based index of this series
  • normalize_stacked_area (boolean) - If set to false the stacked area chart will not normalize the values

Clone this wiki locally