Update c3.js and c3.min.js

parent 09002b4b
......@@ -4418,6 +4418,14 @@
c3_chart_internal_fn.clearLegendItemTextBoxCache = function () {
legendItemTextBox = {};
};
c3_chart_internal_fn.legendText = function (id){
var $$ = this;
return isDefined($$.config.data_names[id]) ?
$$.config.data_names[id] :
isDefined($$.config.data_names.id) ? $$.config.data_names.id : id;
};
c3_chart_internal_fn.updateLegend = function (targetIds, options, transitions) {
var $$ = this, config = $$.config;
var xForLegend, xForLegendText, xForLegendRect, yForLegend, yForLegendText, yForLegendRect;
......@@ -4435,10 +4443,6 @@
$$.clearLegendItemTextBoxCache();
function legendText(id){
return isDefined(config.data_names[id]) ? config.data_names[id] : isDefined(config.data_names.id) ? config.data_names.id : id;
}
function getTextBox(textElement, id) {
if (!legendItemTextBox[id]) {
legendItemTextBox[id] = $$.getTextRect(textElement.textContent, '.c3-legend-item');
......@@ -4575,7 +4579,7 @@
}
});
l.append('text')
.text(legendText)
.text($$.legendText.bind($$))
.each(function (id, i) { updatePositions(this, id, i); })
.style("pointer-events", "none")
.attr('x', $$.isLegendRight || $$.isLegendInset ? xForLegendText : -200)
......@@ -4604,7 +4608,7 @@
texts = $$.legend.selectAll('text')
.data(targetIds)
.text(legendText) // MEMO: needed for update
.text($$.legendText.bind($$)) // MEMO: needed for update
.each(function (id, i) { updatePositions(this, id, i); });
(withTransition ? texts.transition() : texts)
.attr('x', xForLegendText)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment