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

Edit this page on GitHub

Line Charts

The syntax for linecharts is:

DRAW LINECHART
    [ [ WITH ]
          common_chart_options ]

2D Line Charts

All 2D Line Chart series must have at least two columns: x and y. A 2D Line Chart will draw one line connecting all (x, y) points for each series.

The type of the x column can be any of String, DateTime, Numeric. The type of the y column can be any of String, DateTime, 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 line
linestyle (optional) the line style, valid values are solid and none. default: solid
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 line/point color (hex value, eg. #ff0000)

Examples

Multi-Series Line Chart:

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

DRAW LINECHART WITH
   AXIS LEFT
   AXIS BOTTOM
   LEGEND TOP LEFT INSIDE;

SELECT
   city AS series,
   month AS x,
   temperature AS y,
   "Avg. Temperatures in " + month + " in " + city + ": " + temperature as label,
   "circle" as pointstyle
   FROM city_temperatures;

Lines with labels:

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

DRAW LINECHART WITH
   AXIS LEFT
   AXIS BOTTOM
   LABELS
   YDOMAIN -10, 40
   LEGEND TOP LEFT INSIDE;

SELECT city AS series, month AS x, temperature AS y, temperature + "°C" as label, "circle" as pointstyle
   FROM city_temperatures
   WHERE city = "Berlin";