File tree Expand file tree Collapse file tree 1 file changed +15
-14
lines changed
Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -620,22 +620,23 @@ function set_text(t) {
620620 }
621621
622622 function change() {
623- // Filter out any zero values to see if there is anything left
624- var remove_zero_values = dataset[this.value].filter(function(value) {
625- return value > 0;
626- });
627-
628623 // Skip if the value is undefined for some reason
629- if (typeof dataset[this.value] !== 'undefined' && remove_zero_values.length > 0) {
630- $('#graph').find('> svg').show();
631- path = path.data(pie(dataset[this.value])); // update the data
632- path.transition().duration(750).attrTween("d", arcTween); // redraw the arcs
633- // Hide the graph if we can't draw it correctly, not ideal but this works
634- } else {
635- $('#graph').find('> svg').hide();
636- }
624+ if (typeof dataset[this.value] !== 'undefined') {
625+ // Filter out any zero values to see if there is anything left
626+ var remove_zero_values = dataset[this.value].filter(function(value) {
627+ return value > 0;
628+ });
629+ if (remove_zero_values.length > 0) {
630+ $('#graph').find('> svg').show();
631+ path = path.data(pie(dataset[this.value])); // update the data
632+ path.transition().duration(750).attrTween("d", arcTween); // redraw the arcs
633+ // Hide the graph if we can't draw it correctly, not ideal but this works
634+ } else {
635+ $('#graph').find('> svg').hide();
636+ }
637637
638- set_text(this.value);
638+ set_text(this.value);
639+ }
639640 }
640641
641642 function arcTween(a) {
You can’t perform that action at this time.
0 commit comments