|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
c3_chart_internal_fn.initLegend = function () { |
|
|
|
|
var $$ = this; |
|
|
|
|
$$.legendItemTextBox = {}; |
|
|
|
|
$$.legendHasRendered = false; |
|
|
|
|
$$.legend = $$.svg.append("g").attr("transform", $$.getTranslate('legend')); |
|
|
|
|
if (!$$.config.legend_show) { |
|
|
|
@ -107,9 +108,8 @@ c3_chart_internal_fn.hideLegend = function (targetIds) {
|
|
|
|
|
.style('opacity', 0) |
|
|
|
|
.style('visibility', 'hidden'); |
|
|
|
|
}; |
|
|
|
|
var legendItemTextBox = {}; |
|
|
|
|
c3_chart_internal_fn.clearLegendItemTextBoxCache = function () { |
|
|
|
|
legendItemTextBox = {}; |
|
|
|
|
this.legendItemTextBox = {}; |
|
|
|
|
}; |
|
|
|
|
c3_chart_internal_fn.updateLegend = function (targetIds, options, transitions) { |
|
|
|
|
var $$ = this, config = $$.config; |
|
|
|
@ -124,10 +124,10 @@ c3_chart_internal_fn.updateLegend = function (targetIds, options, transitions) {
|
|
|
|
|
withTransitionForTransform = getOption(options, "withTransitionForTransform", true); |
|
|
|
|
|
|
|
|
|
function getTextBox(textElement, id) { |
|
|
|
|
if (!legendItemTextBox[id]) { |
|
|
|
|
legendItemTextBox[id] = $$.getTextRect(textElement.textContent, CLASS.legendItem); |
|
|
|
|
if (!$$.legendItemTextBox[id]) { |
|
|
|
|
$$.legendItemTextBox[id] = $$.getTextRect(textElement.textContent, CLASS.legendItem); |
|
|
|
|
} |
|
|
|
|
return legendItemTextBox[id]; |
|
|
|
|
return $$.legendItemTextBox[id]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function updatePositions(textElement, id, index) { |
|
|
|
|