|
|
@ -15,7 +15,7 @@ c3_chart_internal_fn.xForTitle = function () { |
|
|
|
if (position.indexOf('right') >= 0) { |
|
|
|
if (position.indexOf('right') >= 0) { |
|
|
|
x = $$.currentWidth - $$.getTextRect($$.title.node().textContent, $$.CLASS.title, $$.title.node()).width - config.title_padding.right; |
|
|
|
x = $$.currentWidth - $$.getTextRect($$.title.node().textContent, $$.CLASS.title, $$.title.node()).width - config.title_padding.right; |
|
|
|
} else if (position.indexOf('center') >= 0) { |
|
|
|
} 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
|
|
|
|
} else { // left
|
|
|
|
x = config.title_padding.left; |
|
|
|
x = config.title_padding.left; |
|
|
|
} |
|
|
|
} |
|
|
|