Skip to content

Latest commit

 

History

History
101 lines (81 loc) · 3.17 KB

README.md

File metadata and controls

101 lines (81 loc) · 3.17 KB

Sparkline

PHP script to generate sparklines, with browser cachine with ETag.

Usage

<img src='sparkline.php?size=80x20&data=2,4,5,6,10,7,8,5,7,7,11,8,6,9,11,9,13,14,12,16&back=fff&line=5bb763&fill=d5f7d8' />

Examples

EG1
sparkline.php

EG2
sparkline.php?data=5

EG3
sparkline.php?data=2,4,5,6,10,7,8,5,7,7,11,8,6,9,11,9,13,14,12,16

EG4
sparkline.php?data=2,4,5,6,10,7,8,5,7,7,11,8,6,9,11,9,13,14,12,16&line=5bb763&fill=d5f7d8

EG5
sparkline.php?data=2,4,5,6,10,7,8,5,7,7,11,8,6,9,11,9,13,14,12,16&line=fd8626&fill=ffedde

EG6
sparkline.php?data=2,4,5,6,10,7,8,5,7,7,11,8,6,9,11,9,13,14,12,16&line=ed5565&fill=ffe2e2

EG7
sparkline.php?data=2,4,5,6,10,7,8,5,7,7,11,8,6,9,11,9,13,14,12,16&line=444&fill=eee

EG8
sparkline.php?data=2,4,5,6,10,7,8,5,7,7,11,8,6,9,11,9,13,14,12,16&line=31475c&fill=fff

EG9
sparkline.php?size=185x40&data=2,4,5,6,10,7,8,5,7,7,11,8,6,9,11,9,13,14,12,16

Query Parameters

Key Example Value Default Description
size 100x25, 100 80x20 Width must be between 50 and 80
Height must be between 20 and 800
data 10,20,50,20,30,40,50,120,90 Comma separated list of values to plot
back eeeeee, ddd ffffff Hexadecimal code for background colour
line 555555, 222 1388db Hexadecimal code for line colour
fill cccccc, bbb e6f2fa Hexadecimal code for fill colour

Size Parameter

Value Description
100 Creates a square image 100px in width and 100px in height
80x20 Creates an image 80px in width and 20px in height

License

Sparkline is licensed under the MIT license, see LICENSE.md for details.