From acb361639878852f4a73a280d3bd015d98c1893f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 17 Apr 2017 17:00:13 +1200 Subject: Add more chart options --- web/app/model/Position.js | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'web/app/model/Position.js') diff --git a/web/app/model/Position.js b/web/app/model/Position.js index 3b85a1b7..4b1a429f 100644 --- a/web/app/model/Position.js +++ b/web/app/model/Position.js @@ -58,12 +58,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' @@ -72,12 +66,31 @@ Ext.define('Traccar.model.Position', { type: 'string' }, { 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; } }] }); -- cgit v1.2.3