https://github.com/htwyford/chartist-plugin-targetline
Target line plugin for Chartist.js
https://github.com/htwyford/chartist-plugin-targetline
chartist chartistjs charts plugin
Last synced: 4 months ago
JSON representation
Target line plugin for Chartist.js
- Host: GitHub
- URL: https://github.com/htwyford/chartist-plugin-targetline
- Owner: htwyford
- License: isc
- Created: 2017-08-11T14:45:17.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-03-14T20:23:50.000Z (over 7 years ago)
- Last Synced: 2026-01-23T10:45:59.019Z (5 months ago)
- Topics: chartist, chartistjs, charts, plugin
- Language: JavaScript
- Size: 6.84 KB
- Stars: 3
- Watchers: 1
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Target Line plugin for Chartist.js
A plugin for [Chartist.js](https://github.com/gionkunz/chartist-js) that allows the drawing of a target line on a chart.
## Download
Download from npm:
`npm install chartist-plugin-targetline`
or bower:
`bower install chartist-plugin-targetline`
## Available options and their defaults
```javascript
var defaultOptions = {
value = null,
class = 'ct-target-line'
};
```
## Sample usage in Chartist.js
```javascript
var chart = new Chartist.Line('.ct-chart', {
labels: [1, 2, 3, 4, 5, 6, 7],
series: [
[1, 5, 3, 4, 6, 2, 3],
[2, 4, 2, 5, 4, 3, 6]
]
}, {
plugins: [
Chartist.plugins.ctTargetLine({
value: 1000
})
]
});
```
```css
.ct-target-line {
stroke: blue;
stroke-width: 2px;
stroke-dasharray: 4px;
shape-rendering: crispEdges;
}
```