Socket
Socket
Sign inDemoInstall

dataline

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dataline

Quick and dirty script to draw line graphs. Current features:


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Dataline

Quick and dirty script to draw line graphs. Current features:

  • Min/max/zero line.
  • Min/max labels.
  • Single line.
  • Width-responsive.
  • Drawn onto HTML5 canvas.

Multiple lines, ticks, x-axis labels etc. are not support. There are other libraries that support all of these. It has no dependencies but requires ES5, canvas and requestAnimationFrame support.

Example

HTML/JavaScript code:

<canvas class="chart" id="chart" data-values="1,2,3,-1,-3,0,1,2"></canvas>        
<script src="dataline.js"></script>
<script>Dataline.draw('chart');</script>

CSS code:

.chart { width: 100%; height: 200px; }

Example can be seen on http://demos.rlaanemets.com/dataline/example.html

API

Draw chart:

Dataline.draw(elementId, [array]);

where array is the optional array of numbers for the line. This method must be called only once per element.

License

The MIT License. See the LICENSE file.

Keywords

FAQs

Package last updated on 24 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc