Supported Visualisations

Bar Chart

WITH data AS (
    SELECT 
        current_date + i AS day, 
        (random() * 10000)::integer AS uk_sales, 
        (random() * 10000)::integer AS us_sales
    FROM generate_series(1, 7, 1) i
)
SELECT vis.visualise(
    'Daily Sales',
    vis.bar_chart('Daily Sales',
        vis.dataset( (SELECT jsonb_agg(q.*) FROM data q) ),
        vis.series('UK Sales', 'day', 'uk_sales'),
        vis.series('US Sales', 'day', 'us_sales')
    ),
    vis.option('header', false)
);

Line Chart

WITH data AS (
    SELECT 
        current_date + i AS day, 
        (random() * 10000)::integer AS uk_sales, 
        (random() * 10000)::integer AS us_sales
    FROM generate_series(1, 7, 1) i
)
SELECT vis.visualise(
    'Daily Sales',
    vis.line_chart('Daily Sales',
        vis.dataset( (SELECT jsonb_agg(q.*) FROM data q) ),
        vis.series('UK Sales', 'day', 'uk_sales'),
        vis.series('US Sales', 'day', 'us_sales')
    ),
    vis.option('header', false)
);

Scatter Chart

WITH data AS (
    SELECT 
        current_date + i AS day, 
        (random() * 10000)::integer AS uk_sales, 
        (random() * 10000)::integer AS us_sales
    FROM generate_series(1, 7, 1) i
)
SELECT vis.visualise(
    'Daily Sales',
    vis.scatter_chart('Daily Sales',
        vis.dataset( (SELECT jsonb_agg(q.*) FROM data q) ),
        vis.series('UK Sales vs US Sales', 'uk_sales', 'us_sales')
    ),
    vis.option('header', false)
);

Pie Chart

WITH data AS (
    SELECT 
        current_date + i AS day, 
        (random() * 10000)::integer AS uk_sales, 
        (random() * 10000)::integer AS us_sales
    FROM generate_series(1, 7, 1) i
)
SELECT vis.visualise(
    'Daily Sales',
    vis.pie_chart('Daily Sales',
        vis.dataset( (SELECT jsonb_agg(q.*) FROM data q) ),
        vis.series('UK Sales', 'day', 'uk_sales')
    ),
    vis.option('header', false)
);

Polar Area Chart

WITH data AS (
    SELECT 
        current_date + i AS day, 
        (random() * 10000)::integer AS uk_sales, 
        (random() * 10000)::integer AS us_sales
    FROM generate_series(1, 7, 1) i
)
SELECT vis.visualise(
    'Daily Sales',
    vis.polar_area_chart('Daily Sales',
        vis.dataset( (SELECT jsonb_agg(q.*) FROM data q) ),
        vis.series('UK Sales', 'day', 'uk_sales')
    ),
    vis.option('header', false)
);

Polar Area Chart

WITH data AS (
    SELECT 
        current_date + i AS day, 
        (random() * 10000)::integer AS uk_sales, 
        (random() * 10000)::integer AS us_sales
    FROM generate_series(1, 7, 1) i
)
SELECT vis.visualise(
    'Daily Sales',
    vis.radar_chart('Daily Sales',
        vis.dataset( (SELECT jsonb_agg(q.*) FROM data q) ),
        vis.series('UK Sales', 'day', 'uk_sales')
    ),
    vis.option('header', false)
);

Data Table

WITH data AS (
    SELECT 
        current_date + i AS day, 
        (random() * 10000)::integer AS uk_sales, 
        (random() * 10000)::integer AS us_sales
    FROM generate_series(1, 7, 1) i
)
SELECT vis.visualise(
    'Daily Sales',
    vis.data_table('Daily Sales',
        vis.dataset( (SELECT jsonb_agg(q.*) FROM data q) ),
        vis.column('Day', 'day'),
        vis.column('UK Sales', 'uk_sales'),
        vis.column('US Sales', 'us_sales')
    ),
    vis.option('header', false)
);