|
|
@ -13,9 +13,9 @@ c3_chart_internal_fn.redrawTitle = function () { |
|
|
|
c3_chart_internal_fn.xForTitle = function () { |
|
|
|
c3_chart_internal_fn.xForTitle = function () { |
|
|
|
var $$ = this, config = $$.config, position = config.title_position || 'left', x; |
|
|
|
var $$ = this, config = $$.config, position = config.title_position || 'left', x; |
|
|
|
if (position.indexOf('right') >= 0) { |
|
|
|
if (position.indexOf('right') >= 0) { |
|
|
|
x = $$.currentWidth - $$.title.node().getBBox().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 - $$.title.node().getBBox().width) / 2; |
|
|
|
x = ($$.currentWidth - $$.getTextRect($$.title.node().textContent, $$.CLASS.title, $$.title.node()).width) / 2; |
|
|
|
} else { // left
|
|
|
|
} else { // left
|
|
|
|
x = config.title_padding.left; |
|
|
|
x = config.title_padding.left; |
|
|
|
} |
|
|
|
} |
|
|
@ -23,7 +23,7 @@ c3_chart_internal_fn.xForTitle = function () { |
|
|
|
}; |
|
|
|
}; |
|
|
|
c3_chart_internal_fn.yForTitle = function () { |
|
|
|
c3_chart_internal_fn.yForTitle = function () { |
|
|
|
var $$ = this; |
|
|
|
var $$ = this; |
|
|
|
return $$.config.title_padding.top + $$.title.node().getBBox().height; |
|
|
|
return $$.config.title_padding.top + $$.getTextRect($$.title.node().textContent, $$.CLASS.title, $$.title.node()).height; |
|
|
|
}; |
|
|
|
}; |
|
|
|
c3_chart_internal_fn.getTitlePadding = function() { |
|
|
|
c3_chart_internal_fn.getTitlePadding = function() { |
|
|
|
var $$ = this; |
|
|
|
var $$ = this; |
|
|
|