diff --git a/src/Charts/RTool.cpp b/src/Charts/RTool.cpp index b6b0fbf9c..dd3662a0d 100644 --- a/src/Charts/RTool.cpp +++ b/src/Charts/RTool.cpp @@ -72,16 +72,27 @@ RTool::activity() // access via global as this is a static function if(rtool->context && rtool->context->currentRideItem() && const_cast(rtool->context->currentRideItem())->ride()) { + // get the ride RideFile *f = const_cast(rtool->context->currentRideItem())->ride(); + f->recalculateDerivedSeries(); int points = f->dataPoints().count(); - // run through each data series adding to the frame, if the + // add in actual time in POSIXct format (via Rcpp::Datetime) + Rcpp::DatetimeVector time(points); + for(int k=0; kstartTime().addSecs(f->dataPoints()[k]->secs).toTime_t()); + d["time"] = time; + + // now run through each data series adding to the frame, if the // series does not exist we set all values to NA for(int i=0; i < static_cast(RideFile::none); i++) { // what series we working with? RideFile::SeriesType series = static_cast(i); + // lets not add lots of NA for the more obscure data series + if (i > 15 && !f->isDataPresent(series)) continue; + // set a vector Rcpp::NumericVector vector(points); for(int j=0; j