From 2677360f4bcda5109664c6f2fc93378f46f82760 Mon Sep 17 00:00:00 2001 From: pijey Date: Wed, 25 Mar 2015 11:51:56 +0100 Subject: [PATCH] Add offsetGridLines option to Line charts --- docs/01-Line-Chart.md | 3 +++ src/Chart.Line.js | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/01-Line-Chart.md b/docs/01-Line-Chart.md index 1a5ae84c4..8d164ffb2 100644 --- a/docs/01-Line-Chart.md +++ b/docs/01-Line-Chart.md @@ -102,6 +102,9 @@ These are the customisation options specific to Line charts. These options are m //String - A legend template legendTemplate : "" {% endraw %} + + //Boolean - Whether to horizontally center the label and point dot inside the grid + offsetGridLines : false }; ``` diff --git a/src/Chart.Line.js b/src/Chart.Line.js index 34ad85b4d..9e5673760 100644 --- a/src/Chart.Line.js +++ b/src/Chart.Line.js @@ -50,7 +50,10 @@ datasetFill : true, //String - A legend template - legendTemplate : "" + legendTemplate : "", + + //Boolean - Whether to horizontally center the label and point dot inside the grid + offsetGridLines : false }; @@ -61,6 +64,7 @@ initialize: function(data){ //Declare the extension of the default point, to cater for the options passed in to the constructor this.PointClass = Chart.Point.extend({ + offsetGridLines : this.options.offsetGridLines, strokeWidth : this.options.pointDotStrokeWidth, radius : this.options.pointDotRadius, display: this.options.pointDot, @@ -176,6 +180,7 @@ width : this.chart.width, ctx : this.chart.ctx, textColor : this.options.scaleFontColor, + offsetGridLines : this.options.offsetGridLines, fontSize : this.options.scaleFontSize, fontStyle : this.options.scaleFontStyle, fontFamily : this.options.scaleFontFamily, -- 2.47.2