mirror of https://github.com/masayuki0812/c3.git
Quite good looking graph derived from d3.js
http://c3js.org
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
11 years ago
|
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);
|
||
|
|
||
|
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);
|
||
|
|
||
|
if (options.withLegend) {
|
||
|
$$.hideLegend(targetIds);
|
||
|
}
|
||
|
|
||
|
$$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
|
||
|
};
|
||
|
|
||
|
c3_chart_fn.toggle = function (targetId) {
|
||
|
var $$ = this.internal;
|
||
|
$$.isTargetToShow(targetId) ? this.hide(targetId) : this.show(targetId);
|
||
|
};
|