From f0e6d305f9cdacaaf426339872d50fc1c2025b5c Mon Sep 17 00:00:00 2001 From: Nirothipan Date: Sat, 15 Jul 2017 15:24:42 +0530 Subject: [PATCH] raspberry pi analytics graph fix --- .../raspberrypi_execution/raspberrypi_execution.siddhiql | 2 +- .../public/js/raspberrypi.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_execution/raspberrypi_execution.siddhiql b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_execution/raspberrypi_execution.siddhiql index e20970b98..26bd12347 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_execution/raspberrypi_execution.siddhiql +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_execution/raspberrypi_execution.siddhiql @@ -13,7 +13,7 @@ define stream raspberrypi (meta_owner string, meta_deviceId string, meta_time lo define stream temperature (meta_owner string, meta_deviceType string, meta_deviceId string, meta_time long, temperature float); from raspberrypi -select meta_owner, 'raspberrypi' as meta_deviceType, meta_deviceId, meta_time * 1000 as meta_time, temperature +select meta_owner, 'raspberrypi' as meta_deviceType, meta_deviceId, time:timestampInMilliseconds() as meta_time, temperature insert into temperature; diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.analytics-view/public/js/raspberrypi.js b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.analytics-view/public/js/raspberrypi.js index 8fe6e9276..c2a232de6 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.analytics-view/public/js/raspberrypi.js +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.analytics-view/public/js/raspberrypi.js @@ -168,7 +168,7 @@ function drawGraph_raspberrypi(from, to) { for (var i = 0; i < data.length; i++) { chartData.push( { - x: parseInt(data[i].values.time) - tzOffset, + x: parseInt(data[i].values.meta_time/1000) - tzOffset, y: parseInt(data[i].values.temperature) } );