Metabase Sparklines (yes you can)

This is an adaptation of something I did using Crystal Reports a few years ago. It’s a lot easier in Crystal, but can be done in Metabase if you do something clever in your SQL (use a view is easiest).
As a simple example, create a SQL Question in Metabase:
SELECT 'https://chart.googleapis.com/chart?cht=ls&chs=200x100&chco=FF0000&chd=t:10,20,30,5,50' as chart, 'some text' as charttext
If you paste, be careful that the url doesn’t get &ified.

Second column is just to stop Metabase automatically giving you a big text box.
Then format the first column to display an image:
image

Bingo:
image

Google have a whole stack of charts you can do like this. In theory it’s deprecated, but it’s been like that for years.

Original blog post is here: https://www.pursuittechnology.co.uk/sparkline-charts-in-crystal-reports/
Google play area is here: https://developers.google.com/chart/image/docs/chart_playground

5 Likes

@AndrewMBaines Andrew, you’re awesome!
Just for reference, there’s a request open for sparklines - go and upvote by clicking :+1: on the first post:
https://github.com/metabase/metabase/issues/10338

@AndrewMBaines that’s both fantastic and horrific at the same time. I love it. Thanks for pointing this out, it might come in handy in a pinch.