From: Dan Vanderkam Date: Mon, 4 Apr 2011 23:47:24 +0000 (-0400) Subject: tweak defaults a bit X-Git-Tag: v1.0.0~538 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=b4202b3d4b21a30ed00c6fdfe3d4d39de3034c2b;p=dygraphs.git tweak defaults a bit --- diff --git a/dygraph-canvas.js b/dygraph-canvas.js index b4004e0..522629c 100644 --- a/dygraph-canvas.js +++ b/dygraph-canvas.js @@ -658,7 +658,7 @@ DygraphCanvasRenderer.prototype._renderChartLabels = function() { div.style.width = this.area.w + 'px'; div.style.height = this.attr_('titleHeight') + 'px'; div.style.textAlign = 'center'; - div.style.fontSize = (this.attr_('titleHeight') - 2) + 'px'; + div.style.fontSize = (this.attr_('titleHeight') - 8) + 'px'; div.style.fontWeight = 'bold'; var class_div = document.createElement("div"); class_div.className = 'dygraph-label dygraph-title'; diff --git a/dygraph.js b/dygraph.js index faf77e4..88ad4b8 100644 --- a/dygraph.js +++ b/dygraph.js @@ -194,7 +194,7 @@ Dygraph.DEFAULT_ATTRS = { avoidMinZero: false, // Sizes of the various chart labels. - titleHeight: 18, + titleHeight: 28, xLabelHeight: 18, yLabelWidth: 18, diff --git a/tests/styled-chart-labels.html b/tests/styled-chart-labels.html index c9f9e71..b7af95e 100644 --- a/tests/styled-chart-labels.html +++ b/tests/styled-chart-labels.html @@ -26,16 +26,21 @@ font-size: 18px; text-shadow: gray -2px 2px 2px; /* (offsets are in a rotated frame) */ } + .chart { + border: 1px dashed black; + margin: 5px; + padding: 2px; + }

In this chart, each chart label is styled independently. View source to see how it works.

-
+

This version of the chart uses the default styles:

-
+