|
@@ -155,6 +155,9 @@ export class RatesComponent implements OnInit {
|
|
|
let cargo_energia_b1 = [];
|
|
let cargo_energia_b1 = [];
|
|
|
let cargo_energia_b2 = [];
|
|
let cargo_energia_b2 = [];
|
|
|
let cargo_energia_b3 = [];
|
|
let cargo_energia_b3 = [];
|
|
|
|
|
+ let cargo_energia_punta = [];
|
|
|
|
|
+ let cargo_energia_resto = [];
|
|
|
|
|
+ let cargo_energia_valle = [];
|
|
|
|
|
|
|
|
for (let prop in meterKeys2) {
|
|
for (let prop in meterKeys2) {
|
|
|
console.log();
|
|
console.log();
|
|
@@ -171,72 +174,106 @@ export class RatesComponent implements OnInit {
|
|
|
labels.push(
|
|
labels.push(
|
|
|
`${this.metersValues[prop]["dateMin"]} - ${this.metersValues[prop]["dateMax"]}`
|
|
`${this.metersValues[prop]["dateMin"]} - ${this.metersValues[prop]["dateMax"]}`
|
|
|
);
|
|
);
|
|
|
-
|
|
|
|
|
if (this.metersValues[prop]["cargo_energia"] != "") {
|
|
if (this.metersValues[prop]["cargo_energia"] != "") {
|
|
|
cargo_energia.push(this.metersValues[prop]["cargo_energia"]);
|
|
cargo_energia.push(this.metersValues[prop]["cargo_energia"]);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
if (this.metersValues[prop]["cargo_energia_b1"] != "") {
|
|
if (this.metersValues[prop]["cargo_energia_b1"] != "") {
|
|
|
cargo_energia_b1.push(this.metersValues[prop]["cargo_energia_b1"]);
|
|
cargo_energia_b1.push(this.metersValues[prop]["cargo_energia_b1"]);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
if (this.metersValues[prop]["cargo_energia_b2"] != "") {
|
|
if (this.metersValues[prop]["cargo_energia_b2"] != "") {
|
|
|
cargo_energia_b2.push(this.metersValues[prop]["cargo_energia_b2"]);
|
|
cargo_energia_b2.push(this.metersValues[prop]["cargo_energia_b2"]);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
if (this.metersValues[prop]["cargo_energia_b3"] != "") {
|
|
if (this.metersValues[prop]["cargo_energia_b3"] != "") {
|
|
|
cargo_energia_b3.push(this.metersValues[prop]["cargo_energia_b3"]);
|
|
cargo_energia_b3.push(this.metersValues[prop]["cargo_energia_b3"]);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- /*
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- this.metersData.push(
|
|
|
|
|
- {
|
|
|
|
|
- label: label,
|
|
|
|
|
- backgroundColor: this.barChartColors[prop],
|
|
|
|
|
- data: measure_values,
|
|
|
|
|
- barPercentage: 0.7,
|
|
|
|
|
- borderColor: this.borderChartColors[prop],
|
|
|
|
|
- }
|
|
|
|
|
- );*/
|
|
|
|
|
|
|
+ if (this.metersValues[prop]["cargo_energia_punta"] != "") {
|
|
|
|
|
+ cargo_energia_punta.push(
|
|
|
|
|
+ this.metersValues[prop]["cargo_energia_punta"]
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.metersValues[prop]["cargo_energia_resto"] != "") {
|
|
|
|
|
+ cargo_energia_resto.push(
|
|
|
|
|
+ this.metersValues[prop]["cargo_energia_resto"]
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.metersValues[prop]["cargo_energia_valle"] != "") {
|
|
|
|
|
+ cargo_energia_valle.push(
|
|
|
|
|
+ this.metersValues[prop]["cargo_energia_valle"]
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- console.log(labels);
|
|
|
|
|
this.barChartType = "line";
|
|
this.barChartType = "line";
|
|
|
this.barChartLabels = labels;
|
|
this.barChartLabels = labels;
|
|
|
|
|
|
|
|
- this.metersData.push(
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (cargo_energia.length > 0) {
|
|
|
|
|
+ this.metersData.push({
|
|
|
label: "Cargo energia",
|
|
label: "Cargo energia",
|
|
|
backgroundColor: this.barChartColors[0],
|
|
backgroundColor: this.barChartColors[0],
|
|
|
data: cargo_energia,
|
|
data: cargo_energia,
|
|
|
barPercentage: 0.7,
|
|
barPercentage: 0.7,
|
|
|
borderColor: this.borderChartColors[0],
|
|
borderColor: this.borderChartColors[0],
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (cargo_energia_b1.length > 0) {
|
|
|
|
|
+ this.metersData.push({
|
|
|
label: "Cargo energia bloque 1",
|
|
label: "Cargo energia bloque 1",
|
|
|
backgroundColor: this.barChartColors[1],
|
|
backgroundColor: this.barChartColors[1],
|
|
|
data: cargo_energia_b1,
|
|
data: cargo_energia_b1,
|
|
|
barPercentage: 0.7,
|
|
barPercentage: 0.7,
|
|
|
borderColor: this.borderChartColors[1],
|
|
borderColor: this.borderChartColors[1],
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (cargo_energia_b2.length > 0) {
|
|
|
|
|
+ this.metersData.push({
|
|
|
label: "Cargo energia bloque 2",
|
|
label: "Cargo energia bloque 2",
|
|
|
backgroundColor: this.barChartColors[2],
|
|
backgroundColor: this.barChartColors[2],
|
|
|
data: cargo_energia_b2,
|
|
data: cargo_energia_b2,
|
|
|
barPercentage: 0.7,
|
|
barPercentage: 0.7,
|
|
|
borderColor: this.borderChartColors[2],
|
|
borderColor: this.borderChartColors[2],
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (cargo_energia_b3.length > 0) {
|
|
|
|
|
+ this.metersData.push({
|
|
|
label: "Cargo energia bloque 3",
|
|
label: "Cargo energia bloque 3",
|
|
|
backgroundColor: this.barChartColors[3],
|
|
backgroundColor: this.barChartColors[3],
|
|
|
data: cargo_energia_b3,
|
|
data: cargo_energia_b3,
|
|
|
barPercentage: 0.7,
|
|
barPercentage: 0.7,
|
|
|
borderColor: this.borderChartColors[3],
|
|
borderColor: this.borderChartColors[3],
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (cargo_energia_punta.length > 0) {
|
|
|
|
|
+ this.metersData.push({
|
|
|
|
|
+ label: "Cargo energia punta",
|
|
|
|
|
+ backgroundColor: this.barChartColors[4],
|
|
|
|
|
+ data: cargo_energia_punta,
|
|
|
|
|
+ barPercentage: 0.7,
|
|
|
|
|
+ borderColor: this.borderChartColors[4],
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (cargo_energia_resto.length > 0) {
|
|
|
|
|
+ this.metersData.push({
|
|
|
|
|
+ label: "Cargo energia resto",
|
|
|
|
|
+ backgroundColor: this.barChartColors[5],
|
|
|
|
|
+ data: cargo_energia_resto,
|
|
|
|
|
+ barPercentage: 0.7,
|
|
|
|
|
+ borderColor: this.borderChartColors[5],
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (cargo_energia_valle.length > 0) {
|
|
|
|
|
+ this.metersData.push({
|
|
|
|
|
+ label: "Cargo energia valle",
|
|
|
|
|
+ backgroundColor: this.barChartColors[6],
|
|
|
|
|
+ data: cargo_energia_valle,
|
|
|
|
|
+ barPercentage: 0.7,
|
|
|
|
|
+ borderColor: this.borderChartColors[6],
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/*
|
|
/*
|
|
|
-
|
|
|
|
|
|
|
+ cargo_energia_punta
|
|
|
|
|
+cargo_energia_resto
|
|
|
|
|
+cargo_energia_valle
|
|
|
|
|
+
|
|
|
this.metersValues[0]["data"]
|
|
this.metersValues[0]["data"]
|
|
|
.map((obj) =>
|
|
.map((obj) =>
|
|
|
formatDate(
|
|
formatDate(
|