Skip to content

Commit

Permalink
Clear out chart on each redraw to cover chart.js sizing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
patik committed Mar 23, 2014
1 parent faa1943 commit abc4d8b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions js/dfc/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ var DFC = (function _DFC() {
};

_chart.draw = function _chart_create() {
var $parent = $('#dofChart').parent();
$parent.empty();
$parent.append(
$('<canvas/>').attr('id', 'dofChart')
);

dofChart = new Chart($('#dofChart').get(0).getContext('2d')).Line(_chart.data, _chart.options);
};

Expand Down
2 changes: 1 addition & 1 deletion js/script.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/script.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scss/dfc/_chart.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#dofChart {
display: block;
// display: block;
// width: 100% !important;
// height: 20em !important;
}

0 comments on commit abc4d8b

Please sign in to comment.