Browse Source

Fix axis width when display:none on init - #468

pull/1616/head
Masayuki Tanaka 10 years ago
parent
commit
a6f62166da
  1. 2
      c3.js
  2. 4
      c3.min.js
  3. 2
      src/axis.js

2
c3.js

@ -3935,7 +3935,7 @@
scale = $$.x.copy().domain($$.getXDomain(targetsToShow));
axis = $$.getXAxis(scale, $$.xOrient, $$.getXAxisTickFormat(), config.axis_x_tick_values ? config.axis_x_tick_values : $$.xAxis.tickValues());
}
$$.main.append("g").call(axis).each(function () {
$$.d3.select('body').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; }

4
c3.min.js vendored

File diff suppressed because one or more lines are too long

2
src/axis.js

@ -248,7 +248,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());
}
$$.main.append("g").call(axis).each(function () {
$$.d3.select('body').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