Time series: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 53: Line 53:
         var date = new Date(d[0],d[1],d[2]);                            // Split the date into Year, Month, Day
         var date = new Date(d[0],d[1],d[2]);                            // Split the date into Year, Month, Day
         if (i==0) { startDate = new Date(d[0],d[1],d[2]); }              // Keep the first date in memory
         if (i==0) { startDate = new Date(d[0],d[1],d[2]); }              // Keep the first date in memory
         x = (date.getTime()-startDate.getTime())/ ( 1000.0*60.0*60.0*24.0 );  // The x coordinate of a value is the number of days from the first entry
         x1 = (date.getTime()-startDate.getTime())/ ( 1000.0*60.0*60.0*24.0 );  // The x coordinate of a value is the number of days from the first entry
         y = v;
         y1 = v;
         p = brd2.createElement('point', [x,y],  
         p = brd2.createElement('point', [x1,y1],  
                   {strokeWidth:2, strokeColor:'#ffffff',  
                   {strokeWidth:2, strokeColor:'#ffffff',  
                     highlightStrokeColor:'#0077cc', fillColor:'#0077cc',   
                     highlightStrokeColor:'#0077cc', fillColor:'#0077cc',   

Revision as of 14:05, 17 June 2009


Time series - Google style