Horizontal bar chart with labels

0 2.86 5.71 8.57 11.4 14.3 17.1 20.0 USA CHN JPN DEU FRA GBR BRA RUS ITA IND 16800 Billion $ 9240 Billion $ 4901 Billion $ 3634 Billion $ 2734 Billion $ 2522 Billion $ 2245 Billion $ 2096 Billion $ 2071 Billion $ 1876 Billion $

SQL source code for this example:

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

DRAW BARCHART WITH
    ORIENTATION HORIZONTAL
    LABELS
    AXIS LEFT
    AXIS BOTTOM
    YDOMAIN 0, 20;

SELECT 'gdp per country' AS series, country AS x, gbp / 1000000 AS y, gbp / 1000 + " Billion $" as label
    FROM gdp_per_country
    LIMIT 10;

Run this example:

$ fnordmetric-cli --format=svg examples/barcharts/horizontal_bars.sql