]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Add offsetGridLines option to Line charts 1025/head
authorpijey <pjvilloud-bitbucket@yahoo.fr>
Wed, 25 Mar 2015 10:51:56 +0000 (11:51 +0100)
committerpijey <pjvilloud-bitbucket@yahoo.fr>
Wed, 25 Mar 2015 10:51:56 +0000 (11:51 +0100)
docs/01-Line-Chart.md
src/Chart.Line.js

index 1a5ae84c4a417a752495b5678649e2033d590d6e..8d164ffb2bc7b5d81a55ba7761567fd8a8fd112c 100644 (file)
@@ -102,6 +102,9 @@ These are the customisation options specific to Line charts. These options are m
        //String - A legend template
        legendTemplate : "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].strokeColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"
        {% endraw %}
+
+       //Boolean - Whether to horizontally center the label and point dot inside the grid
+       offsetGridLines : false
 };
 ```
 
index 34ad85b4d0ae1ae96b40b506385ae42547ef6063..9e5673760caa222526eeafedaf47b8e69d1a81d1 100644 (file)
                datasetFill : true,
 
                //String - A legend template
-               legendTemplate : "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].strokeColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"
+               legendTemplate : "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].strokeColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
+
+               //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,
                                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,