Git Product home page Git Product logo

sparkline's Introduction

sparkline Build Status

A JavaScript implementation of spark.

Usage

Node

Install the module with: npm install --save sparkline

var sparkline = require('sparkline');
sparkline([1, 5, 22, 7, 9]);

Command line

Install the module globally with: npm install -g sparkline

$ sparkline 12 43 56 30 15
▁▅█▃▁
$ echo 21,45,6,25,19,15 | sparkline
▃█▁▄▃▂

Browser

Download the script file to your server, and add the script tag to your HTML file.

<script src="http://example.com/sparkline.js"></script>
<script>
  sparkline([8, 31, 5, 20, 24]);
</script>

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

  • 2017-06-23   v0.2.0   Add html option, and fix overflow bug.
  • 2015-07-17   v0.1.2   Add min/max options
  • 2013-06-01   v0.1.1   Support AMD and bower
  • 2013-05-30   v0.1.0   First release.

License

Copyright (c) 2013 Shogo Iwano Licensed under the MIT license.

sparkline's People

Contributors

shiwano avatar emceeaich avatar lipsumar avatar

Stargazers

Favo Yang avatar CH-e avatar Mesut Yiğit avatar Chris Witko avatar Alvar Laigna avatar Stephen avatar 周星星 avatar Christian avatar Guille avatar Anton Fisher avatar Will Sahatdjian avatar Web Worker avatar  avatar Jake Lacey avatar Rocco Musolino avatar M Haidar Hanif avatar Aqib Shah avatar Masaki ISHIYAMA avatar spike grobstein avatar Walker avatar Mehmet Sukan avatar AMAGI / Jun Yuri avatar Volkan Unsal avatar David Middlecamp avatar Bryce Baril avatar Gavin Gilmour avatar Satoshi Ohmori avatar Jason Solis avatar Yuya Ito avatar CHINDA, Kazuyuki avatar Keiji Matsuzaki avatar

Watchers

James Cloos avatar  avatar  avatar

sparkline's Issues

Odd issue with certain values

Hey I am having an odd issue with certain values in sparklines.

The example below only prints one character, if I change the final value of the array to a smaller number it works fine. Any help would be greatly appreciated.

a = [764612.6875, 705419.9375, 1542929.125, 1188870.875, 826327.0625, 593933.625, 876544, 777557.3125, 1029475, 1480014.5, 730282.6875, 955979.0625, 899932.1875, 904396.8125, 1222970, 1281843.25, 875649.6875, 913141.75, 555765.75, 732132.6875, 1044323, 572648.125, 1291031.875, 1942828.375, 1156655.75, 1481093.125, 1225755.25, 665784.3125, 1408389.125, 1055218.375, 638983.875, 823773.875, 1096795.375, 831556.25, 653557.75, 1001308.1875, 652451.8125, 164795.734375, 1461432.375, 927211.5, 1084151.625, 1101910.875, 705454.0625, 615452.3125, 946508.9375, 748625.9375, 609846.625, 946947.4375, 714622.3125, 616360.25, 956573, 1208802.625, 1151489.875, 1724761.25, 850773.3125, 864556.375, 1299271.625, 878407.6875, 807444.5, 1050712.75, 49311764, 101003032, 105960536, 109664921];
console.log(sparkline(a));

Output:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.