This plugin makes it easy to draw high-low line on chartjs.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
images Add an example image Jul 27, 2017
.gitignore updage gitignore Jul 27, 2017
LICENSE Initial commit Jul 27, 2017
README.md Replace SPACE with TAB Jul 31, 2017
chartjs-plugin-highlow.js Don't call drawing many times. Jul 27, 2017

README.md

chartjs-plugin-highlow

This plugin makes it easy to draw high-low line on chartjs.

Usage

options: {
	highlow: {
		high: 0, // index of high-value series
		low: 1, // index of low-value series
		onDrawLine: function (ctx, p0, p1, highlow) { 
			// followings are called after a high-low line has drawn
			// ex. draw arrow shaped line caps
			ctx.save();
			ctx.beginPath();
			ctx.moveTo(p0.x, p0.y);
			ctx.lineTo(p0.x - 3, p0.y + 5);
			ctx.moveTo(p0.x, p0.y);
			ctx.lineTo(p0.x + 3, p0.y + 5);
			ctx.moveTo(p1.x, p1.y);
			ctx.lineTo(p1.x - 3, p1.y - 5);
			ctx.moveTo(p1.x, p1.y);
			ctx.lineTo(p1.x + 3, p1.y - 5);
			ctx.stroke();
			ctx.restore();
		}
	}
}

Screenshots

high-low