Line chart hides when it have to be shown
http://jsfiddle.net/wyrv2c4w/ Open this demo and try to hide data2 by clicking data2 under the chart. So data1 line will not shown. This bug appears in chrome and opera. Firefox and IE11 - OK.
I fix it by adding 2 strings, but i dont know is it correct or not.
c3_chart_fn.show = function (targetIds, options) {
var $$ = this.internal;
targetIds = $$.mapToTargetIds(targetIds);
options = options || {};
$$.removeHiddenTargetIds(targetIds);
$$.svg.selectAll($$.selectorTargets(targetIds))
.transition()
.style('opacity', 1)
.style('display', ''); // FIX STRING
if (options.withLegend) {
$$.showLegend(targetIds);
}
$$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
};
c3_chart_fn.hide = function (targetIds, options) {
var $$ = this.internal;
targetIds = $$.mapToTargetIds(targetIds);
options = options || {};
$$.addHiddenTargetIds(targetIds);
$$.svg.selectAll($$.selectorTargets(targetIds))
.transition()
.style('opacity', 0)
.style('display', 'none'); // FIX STRING 2
if (options.withLegend) {
$$.hideLegend(targetIds);
}
$$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
};
Thank you for reporting. This seems to happen when the difference between data to be shown and hide is huge (if data1 includes over 400, this seems not happen). However, as you investigated, I think this is a kind of bug derived from the browser, so I don't want to apply this fix simply. Also this effects default animation of other types of chart.
I will looking into more, so please give me some time.