This is an alpha release of FnordMetric. Expect bugs and vulnerabilities.

Edit this page on GitHub

Area Charts

The syntax for areacharts is:

DRAW AREACHART
    [ [ WITH ]
          common_chart_options
          [ STACKED ] ]

2D Area Charts

All 2D Area Chart series must have at least two columns: x and y. A 2D Area Chart will draw one area between 0 to y for each x for for each input row.

If multiple series are specified and the STACKED keyword is set in the DRAW AREACHART statement, the series areas will be stacked.

The type of the x column can be any of String, DateTime, Numeric. The type of the y column must be Numeric.

Parameters:

x (mandatory) the x axis value, type can be any of String, DateTime, Numeric
y (mandatory) the y axis value, type can be any of String, DateTime, Numeric
series (optional) if set, each series will be displayed as a separate area
linestyle (optional) the line style, valid values are solid and none. default: none
linewidth (optional) the line width in pixel. default: 2
pointstyle (optional) the point style, valid values are circle and none. default: none.
pointsize (optional) the line width in pixel. default: 4
label (optional) a label to be displayed above each point
color (optional) the area/line/point color (hex value, eg. #ff0000)

3D Area Charts

All 3D Area Chart series must have at least two columns: x, y and z. A 3D Area Chart will draw one area between y to z for each x for for each input row.

If multiple series are specified and the STACKED keyword is set in the DRAW AREACHART statement, the series areas will be stacked.

The type of the x column can be any of String, DateTime, Numeric. The type of the y and z column must be Numeric.

Parameters:

x (mandatory) the x axis value, type can be any of String, DateTime, Numeric
y (mandatory) the lower y bound of the area, type must be numeric
z (mandatory) the upper y bound of the area, type must be numeric
series (optional) if set, each series will be displayed as a separate area
linestyle (optional) the line style, valid values are solid and none. default: none
linewidth (optional) the line width in pixel. default: 2
pointstyle (optional) the point style, valid values are circle and none. default: none.
pointsize (optional) the line width in pixel. default: 4
label (optional) a label to be displayed above each point
color (optional) the area/line/point color (hex value, eg. #ff0000)

Examples

2D Area Chart:

IMPORT TABLE example_data
   FROM 'csv:examples/data/areadata.csv?headers=true';

DRAW AREACHART WITH
   AXIS TOP
   AXIS BOTTOM
   AXIS RIGHT
   AXIS LEFT
   YDOMAIN 0, 50;

SELECT
      'data' AS series,
      x AS x,
      y AS y,
      'circle' as pointstyle,
      'solid' as linestyle,
      3 as pointsize,
      2 as linewidth
   FROM example_data
   WHERE series = "series1";

3D Area Chart:

IMPORT TABLE example_data
   FROM 'csv:examples/data/areadata2.csv?headers=true';

DRAW AREACHART WITH
   AXIS TOP
   AXIS BOTTOM
   AXIS RIGHT
   AXIS LEFT;

SELECT
      series AS series,
      x AS x,
      y AS y,
      z AS z
   FROM example_data
   WHERE series = "series2" or series = "series1";