Skip to content

Commit 27214a4

Browse files
OivalfMarquesgordonwoodhull
authored andcommitted
Change validation of parent in bar chart
1 parent bd883a9 commit 27214a4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/bar-chart.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ dc.barChart = function (parent, chartGroup) {
4242

4343

4444
_chart.type = _type;
45+
4546
dc.override(_chart, 'rescale', function () {
4647
_chart._rescale();
4748
_barWidth = undefined;
@@ -92,9 +93,10 @@ dc.barChart = function (parent, chartGroup) {
9293

9394

9495
function getCharts() {
95-
if (parent instanceof Object) {
96-
if (parent.children() instanceof Array) {
97-
return parent.children().filter(function (chart) {
96+
if (dc.instanceOfChart(parent) && typeof parent.children === 'function') {
97+
var children = parent.children();
98+
if (children instanceof Array) {
99+
return children.filter(function (chart) {
98100
return chart.type === _type;
99101
});
100102
}

0 commit comments

Comments
 (0)