Readme

Sparkline SVG

Sparklines make with vanilla js via @stevekrouse.sparklineSVG

Example usage:

![](https://stevekrouse-sparklineex2.express.val.run/)

Contrast with @stevekrouse.sparklineEx which uses react-sparklines.

1
2
3
4
5
6
7
8
9
10
11
12
13
import { sparklineSVG } from "https://esm.town/v/stevekrouse/sparklineSVG";
export let sparklineEx2 = function (req, res) {
res.set("content-type", "image/svg+xml");
res.end(sparklineSVG({
strokeWidth: 4,
data: [1, 2, 3, 4, 5, 5, 6, 7, 7, 7, 10, 2],
height: "100%",
width: "100%",
fill: "#dcfce7",
stroke: "#bbf7d0",
}));
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
stevekrouse-sparklineex2.express.val.run
October 23, 2023