Browse Source

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.
pull/1395/head
Marcel Bruse 9 years ago
parent
commit
2dd114f249
  1. 2
      src/c3.axis.js

2
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";
}

Loading…
Cancel
Save