Skip to content
Browse files

Set a proper default value for timeInterval and allow to set it via o…

…ptions.


While playing with Rickshaw ive noticed that graph.series.addData only adds one data point and nothing more even if I call it a thousand times. This is because timeInterval is 0 per default so the calculation 

index * this.timeInterval || 1 

always results in 1.
  • Loading branch information...
1 parent f526279 commit 6d2ac24e5d0757bf27c4b5c160408e66ce9860d7 @lanwin committed Jun 29, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/js/Rickshaw.Series.js
View
6 src/js/Rickshaw.Series.js
@@ -7,7 +7,11 @@ Rickshaw.Series = Rickshaw.Class.create( Array, {
options = options || {}
this.palette = new Rickshaw.Color.Palette(palette);
-
+
+ this.setTimeInterval(typeof(options.timeInterval) === 'undefined' ?
+ 1 :
+ options.timeInterval);
+
this.timeBase = typeof(options.timeBase) === 'undefined' ?
Math.floor(new Date().getTime() / 1000) :
options.timeBase;

0 comments on commit 6d2ac24

Please sign in to comment.
Something went wrong with that request. Please try again.