Commit fd96a8e1 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Merge branch 'singleSelection' of https://github.com/hotzenklotz/c3 into…

Merge branch 'singleSelection' of https://github.com/hotzenklotz/c3 into hotzenklotz-singleSelection
parents 13927525 cf4f5e95
......@@ -65,7 +65,9 @@
__data_colors = getConfig(['data', 'colors'], {}),
__data_selection_enabled = getConfig(['data', 'selection', 'enabled'], false),
__data_selection_grouped = getConfig(['data', 'selection', 'grouped'], false),
__data_selection_isselectable = getConfig(['data', 'selection', 'isselectable'], function () { return true; });
__data_selection_isselectable = getConfig(['data', 'selection', 'isselectable'], function () { return true; }),
__data_selection_multiselected = getConfig(['data', 'selection', 'multiselected'], true);
// subchart
var __subchart_show = getConfig(['subchart', 'show'], false),
......@@ -2177,6 +2179,11 @@
}
if (__data_selection_grouped || isWithin) {
if (__data_selection_enabled && __data_selection_isselectable(d)) {
if (!__data_selection_multiselected) {
main.selectAll(target.nodeName).each(function (d, i) {
toggle(false, this, d, i);
});
}
_this.classed(SELECTED, !isSelected);
toggle(!isSelected, _this, d, i);
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
<html>
<head>
<link rel="stylesheet" type="text/css" href="/css/c3.css">
</head>
<body>
<div id="chart"></div>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="/js/c3.js"></script>
<script>
var chart = c3.generate({
bindto: '#chart',
data: {
columns: [
['sample', 30, 200, 100, 400, 150, 250]
],
selection: {
enabled: true,
grouped: true,
multiselected: false
}
}
});
</script>
</body>
</html>
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