From 990d6a3598ceecbfbe639a2683ef9aa1ed933ef9 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Mon, 9 May 2011 09:25:05 -0700 Subject: [PATCH] flesh out docs; split axisLineWIdth and gridLineWidth properties --- dygraph-canvas.js | 4 +-- dygraph.js | 80 ++++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 72 insertions(+), 12 deletions(-) diff --git a/dygraph-canvas.js b/dygraph-canvas.js index 3aba3cd..fb454c9 100644 --- a/dygraph-canvas.js +++ b/dygraph-canvas.js @@ -460,7 +460,7 @@ DygraphCanvasRenderer.prototype.render = function() { var ticks = this.layout.yticks; ctx.save(); ctx.strokeStyle = this.attr_('gridLineColor'); - ctx.lineWidth = this.attr_('axisLineWidth'); + ctx.lineWidth = this.attr_('gridLineWidth'); for (var i = 0; i < ticks.length; i++) { // TODO(danvk): allow secondary axes to draw a grid, too. if (ticks[i][0] != 0) continue; @@ -478,7 +478,7 @@ DygraphCanvasRenderer.prototype.render = function() { var ticks = this.layout.xticks; ctx.save(); ctx.strokeStyle = this.attr_('gridLineColor'); - ctx.lineWidth = this.attr_('axisLineWidth'); + ctx.lineWidth = this.attr_('gridLineWidth'); for (var i=0; i "colorSaturation": { "default": "1.0", "labels": ["Data Series Colors"], - "type": "0.0 - 1.0", + "type": "float (0.0 - 1.0)", "description": "If colors is not specified, saturation of the automatically-generated data series colors." }, "yAxisLabelWidth": { "default": "50", "labels": ["Axis display"], "type": "integer", - "description": "Width, in pixels, of the y-axis labels." + "description": "Width, in pixels, of the y-axis labels. This also affects the amount of space available for a y-axis chart label." }, "hideOverlayOnMouseOut": { "default": "true", @@ -4452,6 +4452,66 @@ Dygraph.OPTIONS_REFERENCE = // "type": "boolean", "description" : "When this option is passed to updateOptions() along with either the dateWindow or valueRange options, the zoom flags are not changed to reflect a zoomed state. This is primarily useful for when the display area of a chart is changed programmatically and also where manual zooming is allowed and use is made of the isZoomed method to determine this." }, + "drawXGrid": { + "default": "true", + "labels": ["Grid"], + "type": "boolean", + "description" : "Whether to display vertical gridlines under the chart." + }, + "drawYGrid": { + "default": "true", + "labels": ["Grid"], + "type": "boolean", + "description" : "Whether to display horizontal gridlines under the chart." + }, + "drawXAxis": { + "default": "true", + "labels": ["Axis display"], + "type": "boolean", + "description" : "Whether to draw the x-axis. Setting this to false also prevents x-axis ticks from being drawn and reclaims the space for the chart grid/lines." + }, + "drawYAxis": { + "default": "true", + "labels": ["Axis display"], + "type": "boolean", + "description" : "Whether to draw the y-axis. Setting this to false also prevents y-axis ticks from being drawn and reclaims the space for the chart grid/lines." + }, + "gridLineWidth": { + "default": "0.3", + "labels": ["Grid"], + "type": "float", + "description" : "Thickness (in pixels) of the gridlines drawn under the chart. The vertical/horizontal gridlines can be turned off entirely by using the drawXGrid and drawYGrid options." + }, + "axisLineWidth": { + "default": "0.3", + "labels": ["Axis display"], + "type": "float", + "description" : "Thickness (in pixels) of the x- and y-axis lines." + }, + "axisLineColor": { + "default": "black", + "labels": ["Axis display"], + "type": "string", + "description" : "Color of the x- and y-axis lines. Accepts any value which the HTML canvas strokeStyle attribute understands, e.g. 'black' or 'rgb(0, 100, 255)'." + }, + "fillAlpha": { + "default": "0.15", + "labels": ["Error bars"], + "type": "float (0.0 - 1.0)", + "description" : "Error bars (or custom bars) for each series are drawn in the same color as the series, but with partial transparency. This sets the transparency. A value of 0.0 means that the error bars will not be drawn, whereas a value of 1.0 means that the error bars will be as dark as the line for the series itself. This can be used to produce chart lines whose thickness varies at each point." + }, + "axisLabelColor": { + "default": "black", + "labels": ["Axis display"], + "type": "string", + "description" : "Color for x- and y-axis labels. This is a CSS color string." + }, + "axisLabelWidth": { + "default": "50", + "labels": ["Axis display"], + "type": "integer", + "description" : "Width (in pixels) of the containing divs for x- and y-axis labels. For the y-axis, this also controls " + }, "sigFigs" : { "default": "null", "labels": ["Value display/formatting"], -- 2.7.4