Spark SVG — sparksvg.me
Mothereffin' SVG sparklines. Check out the demo/test page.
Orignally by Stuart Langridge, based on Jeremy Keith's idea.
<embed src="//sparksvg.me/line.svg?0,4,7,10,8,12,9,7,3,0" type="image/svg+xml">
<embed src="//sparksvg.me/bar.svg?0,4,7,10,8,12,9,7,3,0" type="image/svg+xml">
The circle.svg
redraws itself when the page is resized, so it's always looking smart. Excepting in buggy Firefox, where it can't get its height properly and tries to guess.
<embed src="//sparksvg.me/circle.svg?0,4,7,10,8,12,9,7,3,0" type="image/svg+xml">
You want to contribute? Get started here...
To add a feature, open up the .svg
in a text editor, where you'll find some javascript. Make some changes, make it better and submit your work as a pull request!
This is meant to be a lightweight solution, so please don't add any libraries, and make sure your change works in all the working browsers listed below, by adding a test case to the test.html
.
If it's a new feature, don't edit any of the existing test cases, add a new one, and try them in combination too. The more testing, the merrier.
Tested & working in...
Using the test page. Please do your own testing and add your results, particularly on mobile.
- Chrome
- 23.0.1271.101
- 26.0.1376.0 canary
- Firefox (circles are buggy)
- 17.0.1
- Nightly 20.0a1 (2012-12-11)
- Safari
- 6.0.2
- Opera
- 12.11
- Next 12.50 internal
- Chrome
- 23.0
- 24.0
- Firefox
- 16.0
- 17.0 beta
- Safari
- 5.1
- Opera
- 12.10
- IE
- 9
- Chrome
- 23.0
- 24.0
- Firefox
- 16.0
- 17.0 beta
- Safari
- 5.1
- Opera
- 12.10
- IE
- 10.0
- 10.0 metro using
<object>
doesn't work - recommending<embed>
- 6.0.2
- Mobile Safari
- Chrome
- 23.0
- 5.1 (via browserstack)
- Mobile Safari
- 4.3.2 (via browserstack)
- Mobile Safari
- 4.0
- Browser
- 10.0.4.197
- Browser
- iOS < 4.3.2
- Android < 4.0
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE