From 2dd114f249bab7c781dac3fef0035ada686609bc Mon Sep 17 00:00:00 2001 From: Marcel Bruse Date: Fri, 25 Sep 2015 22:53:44 +0200 Subject: [PATCH] More flexible calculation of tspanDy for tick texts Using a quarter of the height of a char to compute the vertical offset of tick texts in relation to the actual ticks results in a more accurate positioning of the y axis tick texts. This becomes important if you want to change the tick text font size via CSS. --- src/c3.axis.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/c3.axis.js b/src/c3.axis.js index a296c1d..5725f3b 100644 --- a/src/c3.axis.js +++ b/src/c3.axis.js @@ -151,7 +151,7 @@ function c3_axis(d3, params) { var dy = sizeFor1Char.h; if (i === 0) { if (orient === 'left' || orient === 'right') { - dy = -((counts[d.index] - 1) * (sizeFor1Char.h / 2) - 3); + dy = -((counts[d.index] - 1) * (sizeFor1Char.h / 2) - sizeFor1Char.h / 4); } else { dy = ".71em"; }