mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-16 00:00:03 +01:00
58 lines
4.2 KiB
JavaScript
58 lines
4.2 KiB
JavaScript
![]() |
import Ember from 'ember';
|
||
|
|
||
|
export default Ember.Component.extend({
|
||
|
tagName: 'div',
|
||
|
classNames: ['line-chart'],
|
||
|
attributeBindings: ['style'],
|
||
|
xaxisLength: 300,
|
||
|
height: '100%',
|
||
|
|
||
|
didInsertElement: function() {
|
||
|
this._drawPlot();
|
||
|
},
|
||
|
|
||
|
style: function() {
|
||
|
return "height: " + this.get('height') + ";";
|
||
|
}.property('height'),
|
||
|
|
||
|
_drawPlot: function() {
|
||
|
var element = this.get('element');
|
||
|
if (element && element.id) {
|
||
|
// generate plot options
|
||
|
var options = {
|
||
|
series: {
|
||
|
lines: {
|
||
|
show: true,
|
||
|
lineWidth: 2
|
||
|
},
|
||
|
shadowSize: 0
|
||
|
},
|
||
|
xaxis: {
|
||
|
mode: 'time',
|
||
|
timeformat: '%M:%S'
|
||
|
},
|
||
|
yaxis: {
|
||
|
tickDecimals: 3
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// setup plot data
|
||
|
var plotData = [
|
||
|
{
|
||
|
label: 'Total consumption [MW]',
|
||
|
data: [[900.0, 4.61], [1800.0, 4.49], [2700.0, 4.51], [3600.0, 4.45], [4500.0, 4.90], [5400.0, 4.76], [6300.0, 4.77], [7200.0, 4.70], [8100.0, 4.73], [9000.0, 4.80], [9900.0, 4.89], [10800.0, 4.81], [11700.0, 4.65], [12600.0, 4.59], [13500.0, 4.65], [14400.0, 4.82], [15300.0, 4.62], [16200.0, 4.73], [17100.0, 4.62], [18000.0, 4.65], [18900.0, 4.77], [19800.0, 4.79], [20700.0, 5.57], [21600.0, 6.14], [22500.0, 8.33], [23400.0, 9.56], [24300.0, 10.94], [25200.0, 11.03], [26100.0, 12.34], [27000.0, 13.36], [27900.0, 14.13], [28800.0, 15.00], [29700.0, 15.61], [30600.0, 16.70], [31500.0, 17.21], [32400.0, 18.31], [33300.0, 17.85], [34200.0, 18.04], [35100.0, 17.72], [36000.0, 18.02], [36900.0, 17.64], [37800.0, 18.26], [38700.0, 18.30], [39600.0, 18.72], [40500.0, 18.60], [41400.0, 18.54], [42300.0, 18.31], [43200.0, 16.91], [44100.0, 13.61], [45000.0, 12.47], [45900.0, 15.83], [46800.0, 15.73], [47700.0, 16.38], [48600.0, 16.19], [49500.0, 17.06], [50400.0, 16.71], [51300.0, 15.89], [52200.0, 15.99], [53100.0, 15.50], [54000.0, 15.58], [54900.0, 15.66], [55800.0, 15.50], [56700.0, 15.63], [57600.0, 15.67], [58500.0, 15.79], [59400.0, 15.39], [60300.0, 14.85], [61200.0, 13.97], [62100.0, 13.31], [63000.0, 12.83], [63900.0, 12.53], [64800.0, 11.78], [65700.0, 11.56], [66600.0, 11.67], [67500.0, 10.97], [68400.0, 10.20], [69300.0, 9.59], [70200.0, 8.94], [71100.0, 8.97], [72000.0, 9.86], [72900.0, 10.25], [73800.0, 9.54], [74700.0, 10.04], [75600.0, 9.98], [76500.0, 9.44], [77400.0, 8.91], [78300.0, 8.39], [79200.0, 7.00], [80100.0, 5.07], [81000.0, 4.80], [81900.0, 4.67], [82800.0, 4.19], [83700.0, 4.16], [84600.0, 4.25], [85500.0, 4.40], [86400.0, 4.38]],
|
||
|
color: "rgb(51, 153, 255)"
|
||
|
},
|
||
|
{
|
||
|
label: 'Total PV generation [MW]',
|
||
|
data: [[900.0, 0.00], [1800.0, 0.00], [2700.0, 0.00], [3600.0, 0.00], [4500.0, 0.00], [5400.0, 0.00], [6300.0, 0.00], [7200.0, 0.00], [8100.0, 0.00], [9000.0, 0.00], [9900.0, 0.00], [10800.0, 0.00], [11700.0, 0.00], [12600.0, 0.00], [13500.0, 0.00], [14400.0, 0.00], [15300.0, 0.00], [16200.0, 0.00], [17100.0, 0.00], [18000.0, 0.00], [18900.0, 0.00], [19800.0, 0.00], [20700.0, 0.00], [21600.0, 0.00], [22500.0, 0.00], [23400.0, 0.00], [24300.0, 0.00], [25200.0, 0.15], [26100.0, 0.63], [27000.0, 0.63], [27900.0, 0.54], [28800.0, 0.27], [29700.0, 0.43], [30600.0, 0.46], [31500.0, 0.19], [32400.0, 0.35], [33300.0, 0.47], [34200.0, 0.44], [35100.0, 0.62], [36000.0, 0.61], [36900.0, 0.85], [37800.0, 1.48], [38700.0, 2.35], [39600.0, 1.08], [40500.0, 1.20], [41400.0, 2.71], [42300.0, 1.84], [43200.0, 1.83], [44100.0, 1.48], [45000.0, 4.24], [45900.0, 0.43], [46800.0, 0.43], [47700.0, 0.23], [48600.0, 0.19], [49500.0, 0.09], [50400.0, 0.02], [51300.0, 0.73], [52200.0, 0.86], [53100.0, 0.85], [54000.0, 0.85], [54900.0, 1.76], [55800.0, 2.37], [56700.0, 2.37], [57600.0, 2.13], [58500.0, 1.76], [59400.0, 1.68], [60300.0, 2.57], [61200.0, 2.37], [62100.0, 1.59], [63000.0, 2.52], [63900.0, 1.58], [64800.0, 1.06], [65700.0, 0.89], [66600.0, 0.73], [67500.0, 0.86], [68400.0, 1.54], [69300.0, 0.85], [70200.0, 0.65], [71100.0, 0.43], [72000.0, 0.23], [72900.0, 0.19], [73800.0, 0.09], [74700.0, 0.02], [75600.0, 0.01], [76500.0, 0.00], [77400.0, 0.00], [78300.0, 0.00], [79200.0, 0.00], [80100.0, 0.00], [81000.0, 0.00], [81900.0, 0.00], [82800.0, 0.00], [83700.0, 0.00], [84600.0, 0.00], [85500.0, 0.00], [86400.0, 0.00]],
|
||
|
color: "rgb(255, 91, 51)"
|
||
|
}
|
||
|
];
|
||
|
|
||
|
// draw plot
|
||
|
$.plot('#' + element.id, plotData, options);
|
||
|
}
|
||
|
}
|
||
|
});
|