diff --git a/src/title.js b/src/title.js index a58b68e..18477b9 100644 --- a/src/title.js +++ b/src/title.js @@ -15,7 +15,7 @@ c3_chart_internal_fn.xForTitle = function () { if (position.indexOf('right') >= 0) { x = $$.currentWidth - $$.getTextRect($$.title.node().textContent, $$.CLASS.title, $$.title.node()).width - config.title_padding.right; } else if (position.indexOf('center') >= 0) { - x = ($$.currentWidth - $$.getTextRect($$.title.node().textContent, $$.CLASS.title, $$.title.node()).width) / 2; + x = Math.max(($$.currentWidth - $$.getTextRect($$.title.node().textContent, $$.CLASS.title, $$.title.node()).width) / 2, 0); } else { // left x = config.title_padding.left; }