Update internal data array when using setData (fixes #213).

This commit is contained in:
Olly Smith 2013-05-12 16:56:25 +01:00
parent 6220c40217
commit 8bc716f820
3 changed files with 4 additions and 1 deletions

View File

@ -97,6 +97,8 @@ class Morris.Grid extends Morris.EventEmitter
# Update the data series and redraw the chart.
#
setData: (data, redraw = true) ->
@options.data = data
if !data? or data.length == 0
@data = []
@raphael.clear()

View File

@ -151,6 +151,7 @@
if (redraw == null) {
redraw = true;
}
this.options.data = data;
if (!(data != null) || data.length === 0) {
this.data = [];
this.raphael.clear();

2
morris.min.js vendored

File diff suppressed because one or more lines are too long