Browse Source

#587 Graph labeling issue

Large graph labels could cause wrapping inside the tick tags adding to determine maximum size, adding to svg element instead of html fixes this issue.
pull/590/head
Chris Hallson 10 years ago
parent
commit
057a31783e
  1. 2
      src/axis.js

2
src/axis.js

@ -255,7 +255,7 @@ c3_chart_internal_fn.getMaxTickWidth = function (id) {
scale = $$.x.copy().domain($$.getXDomain(targetsToShow));
axis = $$.getXAxis(scale, $$.xOrient, $$.getXAxisTickFormat(), config.axis_x_tick_values ? config.axis_x_tick_values : $$.xAxis.tickValues());
}
$$.d3.select('body').append("g").style('visibility', 'hidden').call(axis).each(function () {
$$.svg.append("g").style('visibility', 'hidden').call(axis).each(function () {
$$.d3.select(this).selectAll('text').each(function () {
var box = this.getBoundingClientRect();
if (maxWidth < box.width) { maxWidth = box.width; }

Loading…
Cancel
Save