mirror of
https://gitlab.silvrtree.co.uk/martind2000/mdot_server.git
synced 2025-02-25 03:33:35 +00:00
new graph
This commit is contained in:
parent
3721138bad
commit
81b5cddd28
@ -273,9 +273,19 @@ var self = this;
|
||||
|
||||
var chartData = [];
|
||||
|
||||
var temporal = {high:0, low:0};
|
||||
|
||||
_(this.collection.models).each(function(i) {
|
||||
var dt = i.get('dt');
|
||||
if (temporal.low === 0 || dt < temporal.low) {
|
||||
temporal.low = dt;
|
||||
}
|
||||
if (temporal.high === 0 || dt > temporal.high) {
|
||||
temporal.high = dt;
|
||||
}
|
||||
|
||||
chartData.push({
|
||||
date: i.get('dt'),
|
||||
date: dt,
|
||||
value: i.get(getMode)
|
||||
});
|
||||
|
||||
@ -349,8 +359,8 @@ var self = this;
|
||||
// first trend line
|
||||
var trendLine = new AmCharts.TrendLine();
|
||||
// note,when creating date objects 0 month is January, as months are zero based in JavaScript.
|
||||
trendLine.initialDate = new Date(2016, 7, 8, 12); // 12 is hour - to start trend line in the middle of the day
|
||||
trendLine.finalDate = new Date(2012, 7, 15, 12);
|
||||
trendLine.initialDate = temporal.low; // 12 is hour - to start trend line in the middle of the day
|
||||
trendLine.finalDate = temporal.high;
|
||||
trendLine.initialValue = 10;
|
||||
trendLine.finalValue = 19;
|
||||
trendLine.lineColor = "#CC0000";
|
||||
@ -358,8 +368,8 @@ var self = this;
|
||||
|
||||
// second trend line
|
||||
trendLine = new AmCharts.TrendLine();
|
||||
trendLine.initialDate = new Date(2016, 7, 8, 12); // 12 is hour - to start trend line in the middle of the day
|
||||
trendLine.finalDate = new Date(2012, 7, 15, 12);
|
||||
trendLine.initialDate = temporal.low; // 12 is hour - to start trend line in the middle of the day
|
||||
trendLine.finalDate = new temporal.high;
|
||||
trendLine.initialValue = 16;
|
||||
trendLine.finalValue = 10;
|
||||
trendLine.lineColor = "#CC0000";
|
||||
|
Loading…
Reference in New Issue
Block a user