🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

chartjs-lines-plugin

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chartjs-lines-plugin

Enables a simple API to add horizontal or vertical lines to ChartJS 2.0 graphs

1.0.3
latest
Source
npm
Version published
Weekly downloads
7
Maintainers
1
Weekly downloads
 
Created
Source

ChartJS Horizontal Line Plugin

I found this code at http://stackoverflow.com/questions/38324238/draw-horizontal-lines-in-chart-js-2-0 and it helped me immensely, so I packaged it as an NPM module for others to easily add to their project.

Installation

  • Install with npm: npm install --save chartjs-horizontal-line-plugin.
  • Include the dist/chartjs-horizontal-line-plugin.js file (after ChartJS).

Usage

Add one (or both!) of the following array to your chart's options property:

    "horizontalLine": [{
        "y": 260,
        "style": "rgba(255, 0, 0, .4)",
        "text": "max"
    },{
        "y": 220,
        "style": "rgba(0, 255, 0, .4)",
        "text": "min"
    }],
    "verticalLine": [{
        "x": 260,
        "style": "rgba(255, 0, 0, .4)",
        "text": "max"
    },{
        "x": 220,
        "style": "rgba(0, 255, 0, .4)",
        "text": "min"
    }]

That's it!

Keywords

chartjs

FAQs

Package last updated on 06 Feb 2017

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