From b4202b3d4b21a30ed00c6fdfe3d4d39de3034c2b Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Mon, 4 Apr 2011 19:47:24 -0400 Subject: [PATCH] tweak defaults a bit --- dygraph-canvas.js | 2 +- dygraph.js | 2 +- tests/styled-chart-labels.html | 13 +++++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) 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:

-
+