diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-04-17 17:00:13 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-04-17 17:00:13 +1200 |
commit | acb361639878852f4a73a280d3bd015d98c1893f (patch) | |
tree | 9000afed593a1a8d740bc0f712628a822cd8a876 /web/app | |
parent | 789a699ede9e4d1071c6212c5460d20c453a6fa0 (diff) | |
download | etbsa-traccar-web-acb361639878852f4a73a280d3bd015d98c1893f.tar.gz etbsa-traccar-web-acb361639878852f4a73a280d3bd015d98c1893f.tar.bz2 etbsa-traccar-web-acb361639878852f4a73a280d3bd015d98c1893f.zip |
Add more chart options
Diffstat (limited to 'web/app')
-rw-r--r-- | web/app/model/Position.js | 29 | ||||
-rw-r--r-- | web/app/store/ReportChartTypes.js | 6 |
2 files changed, 27 insertions, 8 deletions
diff --git a/web/app/model/Position.js b/web/app/model/Position.js index 3b85a1b..4b1a429 100644 --- a/web/app/model/Position.js +++ b/web/app/model/Position.js @@ -59,12 +59,6 @@ Ext.define('Traccar.model.Position', { name: 'speed', type: 'float' }, { - name: 'speedConverted', - type: 'float', - calculate: function (data) { - return Ext.getStore('SpeedUnits').convertValue(data.speed, Traccar.app.getPreference('speedUnit')); - } - }, { name: 'course', type: 'float' }, { @@ -73,11 +67,30 @@ Ext.define('Traccar.model.Position', { }, { name: 'attributes' }, { + name: 'speedConverted', + type: 'float', + calculate: function (data) { + return Ext.getStore('SpeedUnits').convertValue( + data.speed, Traccar.app.getPreference('speedUnit')); + } + }, { name: 'distanceConverted', type: 'float', calculate: function (data) { - return Ext.getStore('DistanceUnits').convertValue(data.attributes.distance, - Traccar.app.getPreference('distanceUnit')); + return Ext.getStore('DistanceUnits').convertValue( + data.attributes.distance, Traccar.app.getPreference('distanceUnit')); + } + }, { + name: 'rpm', + type: 'float', + calculate: function (data) { + return data.attributes.rpm; + } + }, { + name: 'fuel', + type: 'float', + calculate: function (data) { + return data.attributes.fuel; } }] }); diff --git a/web/app/store/ReportChartTypes.js b/web/app/store/ReportChartTypes.js index 7a63fd0..889db50 100644 --- a/web/app/store/ReportChartTypes.js +++ b/web/app/store/ReportChartTypes.js @@ -26,5 +26,11 @@ Ext.define('Traccar.store.ReportChartTypes', { }, { key: 'distanceConverted', name: Strings.positionDistance + }, { + key: 'rpm', + name: Strings.positionRpm + }, { + key: 'fuel', + name: Strings.positionFuel }] }); |