|
|
@@ -4,8 +4,8 @@ import { Label, BaseChartDirective } from 'ng2-charts';
|
|
|
import { MeasuresService } from 'src/app/services/measures.service';
|
|
|
import { PlantsService } from 'src/app/services/plants.service';
|
|
|
import { LogsService } from 'src/app/services/logs.service';
|
|
|
-
|
|
|
import { OrganizationsService } from '@app/services/organizations.service';
|
|
|
+
|
|
|
import { ActivatedRoute } from '@angular/router';
|
|
|
import { MatPaginator } from '@angular/material/paginator';
|
|
|
import { MatSort } from '@angular/material/sort';
|
|
|
@@ -51,7 +51,7 @@ export class AssetsComponent implements OnInit {
|
|
|
environmentCO2:any;
|
|
|
environmentHouse:any;
|
|
|
environmentFuel:any;
|
|
|
- isActive:[boolean,boolean,boolean,boolean,boolean,boolean,boolean,boolean]; //Activated param (chart)
|
|
|
+ isActive:[boolean,boolean,boolean,boolean,boolean,boolean,boolean,boolean,boolean]; //Activated param (chart)
|
|
|
chartActive:[boolean,boolean,boolean,boolean]
|
|
|
initialLoad: boolean = true;
|
|
|
metersInstalled:boolean = true;
|
|
|
@@ -96,6 +96,11 @@ export class AssetsComponent implements OnInit {
|
|
|
public barChartOptions: ChartOptions;
|
|
|
public barChartData: ChartDataSets[];
|
|
|
@ViewChild("baseChart",null) chart: BaseChartDirective;
|
|
|
+ city: any;
|
|
|
+ total_savings: any;
|
|
|
+ last_day_savings: number;
|
|
|
+ savings_logs: any;
|
|
|
+ savings_logs_data = [];
|
|
|
|
|
|
|
|
|
// Get selected asset
|
|
|
@@ -136,7 +141,7 @@ export class AssetsComponent implements OnInit {
|
|
|
}
|
|
|
|
|
|
// Initialize default 'clicked' options for chart button options
|
|
|
- this.isActive = [false, false, false, false, false, false, false, false];
|
|
|
+ this.isActive = [false, false, false, false, false, false, false, false, false];
|
|
|
|
|
|
this.chartActive = [true, false, false, false];
|
|
|
|
|
|
@@ -150,12 +155,21 @@ export class AssetsComponent implements OnInit {
|
|
|
|
|
|
if (this.assetID == undefined){
|
|
|
this.assetID = this.listAssets[0].id;
|
|
|
+ this.city = this.listAssets[0].city;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.city = this.listAssets.find(object=>object.id == this.assetID).city;
|
|
|
}
|
|
|
|
|
|
let tempAsset = this.listAssets.find(object=>object.id == this.assetID);
|
|
|
|
|
|
if (tempAsset["meters_installed"].length > 0){
|
|
|
this.metersInstalled = true;
|
|
|
+
|
|
|
+
|
|
|
+ // Get savings produced by an asset
|
|
|
+ this.getSavings(this.assetID);
|
|
|
+
|
|
|
// Get energy produced given an asset
|
|
|
this.getEnergyProduced(this.assetID);
|
|
|
// Initialize a draw chart according to the default values
|
|
|
@@ -172,7 +186,7 @@ export class AssetsComponent implements OnInit {
|
|
|
Swal.fire({
|
|
|
type: 'error',
|
|
|
title: 'Error en el servidor',
|
|
|
- text: "No su pudo obtener la informacion"
|
|
|
+ text: err.message
|
|
|
});
|
|
|
});
|
|
|
|
|
|
@@ -181,7 +195,7 @@ export class AssetsComponent implements OnInit {
|
|
|
Swal.close();
|
|
|
}, 2700);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// Default check asset dropdown if a value is equal to an assetID
|
|
|
isSelected(){
|
|
|
if(this.assetID!=undefined){
|
|
|
@@ -202,9 +216,11 @@ export class AssetsComponent implements OnInit {
|
|
|
onChangeObj(event:any) {
|
|
|
this.assetID = event.target.value;
|
|
|
let tempAsset = this.listAssets.find(object=>object.id == this.assetID);
|
|
|
+ this.city = tempAsset["city"];
|
|
|
|
|
|
if (tempAsset["meters_installed"].length > 0){
|
|
|
this.metersInstalled = true;
|
|
|
+ this.getSavings(this.assetID);
|
|
|
this.getEnergyProduced(this.assetID);
|
|
|
this.getMeasureRangeChart(this.view, this.initialDate, this.assetID);
|
|
|
this.getEnvironmentalData(this.assetID);
|
|
|
@@ -223,24 +239,20 @@ export class AssetsComponent implements OnInit {
|
|
|
onDateChanged(event: IMyDateModel) {
|
|
|
let endDate = `${event.singleDate.date.year}-${event.singleDate.date.month}-${event.singleDate.date.day}`;
|
|
|
this.initialDate = endDate;
|
|
|
- switch (this.view)
|
|
|
- {
|
|
|
- case "day":
|
|
|
- this.getMeasureRangeChart(this.view, endDate);
|
|
|
- break;
|
|
|
- case "week":
|
|
|
- this.getMeasureRangeChart(this.view, endDate);
|
|
|
- break;
|
|
|
- case "month":
|
|
|
- this.getMeasureRangeChart(this.view, endDate);
|
|
|
- break;
|
|
|
- case "year":
|
|
|
- this.getMeasureRangeChart(this.view, endDate);
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
+
|
|
|
+ this.getMeasureRangeChart(this.view, endDate);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ getSavings(assetID: string) {
|
|
|
+ this.plantsService.getAssetSavings(this.assetID).subscribe( res => {
|
|
|
+ this.total_savings = res["data"]["ahorro_total"];
|
|
|
+ this.total_savings = +this.total_savings > 10000 ? (+this.total_savings / 1000).toFixed(3) + "k" : +this.total_savings.toFixed(2) || 0;
|
|
|
+ this.last_day_savings = +res["data"]["ahorro_ultimas_24_horas"].toFixed(2) || 0;
|
|
|
+ })
|
|
|
}
|
|
|
+
|
|
|
|
|
|
getEnvironmentalData(assetID: string) {
|
|
|
this.logsService.getAssetEnviromentalStats(assetID).subscribe(resp => {
|
|
|
@@ -312,177 +324,212 @@ export class AssetsComponent implements OnInit {
|
|
|
|
|
|
case "day":
|
|
|
interval = "1D";
|
|
|
- this.isActive = [true, false, false, false, false, false, false, false];
|
|
|
+ this.isActive = [true, false, false, false, false, false, false, false, false];
|
|
|
break;
|
|
|
case "week":
|
|
|
interval = "7D";
|
|
|
- this.isActive = [false, true, false, false, false, false, false, false];
|
|
|
+ this.isActive = [false, true, false, false, false, false, false, false, false];
|
|
|
break;
|
|
|
- case "wtd":
|
|
|
+ case "WTD":
|
|
|
interval = "WTD"
|
|
|
- this.isActive = [false, false, true, false, false, false, false, false]
|
|
|
+ this.isActive = [false, false, true, false, false, false, false, false, false];
|
|
|
+ break;
|
|
|
case "month":
|
|
|
interval = "1M";
|
|
|
- this.isActive = [false, false, false, true, false, false, false, false];
|
|
|
+ this.isActive = [false, false, false, true, false, false, false, false, false];
|
|
|
break;
|
|
|
- case "mtd":
|
|
|
+ case "MTD":
|
|
|
interval = "MTD";
|
|
|
- this.isActive = [false, false, false, false, true, false, false, false];
|
|
|
+ this.isActive = [false, false, false, false, true, false, false, false, false];
|
|
|
+ break;
|
|
|
case "3m":
|
|
|
interval = "3M";
|
|
|
- this.isActive = [false, false, false, false, false, true, false, false];
|
|
|
+ this.isActive = [false, false, false, false, false, true, false, false, false];
|
|
|
break;
|
|
|
- case "year":
|
|
|
+ case "12m":
|
|
|
+ interval = "1Y";
|
|
|
+ this.isActive = [false, false, false, false, false, false, true, false, false];
|
|
|
+ break;
|
|
|
+ case "YTD":
|
|
|
interval = "YTD";
|
|
|
- this.isActive = [false, false, false, false, false, false, true, false];
|
|
|
+ this.isActive = [false, false, false, false, false, false, false, true, false];
|
|
|
+ break;
|
|
|
case "total":
|
|
|
interval = "TOTAL";
|
|
|
- this.isActive = [false, false, false, false, false, false, false, true];
|
|
|
+ this.isActive = [false, false, false, false, false, false, false, false, true];
|
|
|
+ break;
|
|
|
default:
|
|
|
}
|
|
|
|
|
|
- // Get the measures according to the meters, given the params required
|
|
|
- this.logsService.getEnergyProducedByParams(assetId,interval,dateRange).toPromise()
|
|
|
- .then((data: any) => {
|
|
|
- this.metersData = [];
|
|
|
- this.metersKeys = Object.keys(data["data"]["dataset"]);
|
|
|
-
|
|
|
- // Get all the values according to each index (meter)
|
|
|
- this.metersValues = Object.values(data["data"]["dataset"]);
|
|
|
-
|
|
|
- /// Get the keys of those values
|
|
|
- let meterKeys2 = Object.keys(this.metersValues);
|
|
|
- this.displayedColumns= [];
|
|
|
- this.tableData = [];
|
|
|
-
|
|
|
- // The chart data object requires certain ordered params, so we itirate the returned object from the API call,
|
|
|
- // and build the new object with the required/needed values
|
|
|
- for (let prop in meterKeys2) {
|
|
|
- //let label = localStorage.getItem("email") == "inverlec@grupomerelec.com" ? `INVERLEC ${prop}` : this.metersValues[prop]["label"];
|
|
|
- let label = this.metersValues[prop]["label"];
|
|
|
- let measure_values = Object.values(this.metersValues[prop]["data"].map(obj => obj.total_energy_kWh).reverse())
|
|
|
- this.metersData.push({"label": label, backgroundColor: this.barChartColors[prop], data: measure_values, borderColor: this.borderChartColors[prop] });
|
|
|
- this.tableData.push({headers: label+" [kWh]", dataValues: measure_values})
|
|
|
+ this.logsService.getEnergySavingsProducedByAsset(assetId, interval, dateRange).toPromise()
|
|
|
+ .then((res: any)=>{
|
|
|
+ this.savings_logs = undefined;
|
|
|
+ this.savings_logs_data = [];
|
|
|
+ this.savings_logs = res["data"]["dataset"];
|
|
|
+ let savingsKeys = Object.keys(this.savings_logs);
|
|
|
+ for (let key in savingsKeys) {
|
|
|
+ let savingDate = savingsKeys[key];
|
|
|
+ this.savings_logs_data.push(this.savings_logs[savingDate]["ahorro"]);
|
|
|
}
|
|
|
|
|
|
- // Initialization of arrays for the table view of the measure values
|
|
|
- this.array1 = this.array2 = this.array3 = [];
|
|
|
-
|
|
|
- // Loop to build an object that contains the date and each meter value from a certain asset
|
|
|
- // This object is required to build the datatable
|
|
|
- for (let prop in meterKeys2) {
|
|
|
- this.array2 = [];
|
|
|
- //let label = localStorage.getItem("email") == "inverlec@grupomerelec.com" ? `INVERLEC ${prop}` : this.metersValues[prop]["label"];
|
|
|
- let quantity = Object.keys(this.metersValues[0]["data"]);
|
|
|
- let mvalues = Object.values(this.metersValues[prop]["data"].map(obj => obj).reverse())
|
|
|
+ // Get the measures according to the meters, given the params required
|
|
|
+ this.logsService.getEnergyProducedByParams(assetId,interval,dateRange).toPromise()
|
|
|
+ .then((data: any) => {
|
|
|
+ this.metersData = [];
|
|
|
+ this.metersKeys = Object.keys(data["data"]["dataset"]);
|
|
|
|
|
|
- for (let prop2 in quantity){
|
|
|
- // Date insertion
|
|
|
- this.array3 = [];
|
|
|
- let columnname = `medidor${prop}`;
|
|
|
-
|
|
|
- if (+prop == 0 && mvalues[prop2] != undefined){
|
|
|
- let dateT = this.getDateWithFormat(this.view, mvalues[prop2]["dateMax"])
|
|
|
- this.array3.push(dateT);
|
|
|
- }
|
|
|
+ // Get all the values according to each index (meter)
|
|
|
+ this.metersValues = Object.values(data["data"]["dataset"]);
|
|
|
+
|
|
|
+ /// Get the keys of those values
|
|
|
+ let meterKeys2 = Object.keys(this.metersValues);
|
|
|
+ this.displayedColumns= [];
|
|
|
+ this.tableData = [];
|
|
|
+ this.metersData.push({ "label": "AHORRO [US$]", data: this.savings_logs_data.reverse(), type: "line", backgroundColor: "#e57272", borderColor: "#ce2525", borderWidth: 2, yAxisID: 'y-axis-ahorro', fill: false})
|
|
|
+ // The chart data object requires certain ordered params, so we itirate the returned object from the API call,
|
|
|
+ // and build the new object with the required/needed values
|
|
|
+ for (let prop in meterKeys2) {
|
|
|
+ //let label = localStorage.getItem("email") == "inverlec@grupomerelec.com" ? `INVERLEC ${prop}` : this.metersValues[prop]["label"];
|
|
|
+ let label = this.metersValues[prop]["label"]+" [kWh]";
|
|
|
+ let measure_values = Object.values(this.metersValues[prop]["data"].map(obj => obj.total_energy_kWh).reverse());
|
|
|
+ this.metersData.push({"label": label, backgroundColor: this.barChartColors[prop], data: measure_values, borderColor: this.borderChartColors[prop] });
|
|
|
+ this.tableData.push({headers: label+" [kWh]", dataValues: measure_values});
|
|
|
+ }
|
|
|
+
|
|
|
+ // this.metersData.push({ "label": "Ahorro", data: [10,30,30,40,30,20,15,25,30,35], type: "line", backgroundColor: "#e57272", borderColor: "#ce2525", borderWidth: 2, yAxisID: 'y-axis-ahorro',})
|
|
|
+ // Initialization of arrays for the table view of the measure values
|
|
|
+ this.array1 = this.array2 = this.array3 = [];
|
|
|
+
|
|
|
+ // Loop to build an object that contains the date and each meter value from a certain asset
|
|
|
+ // This object is required to build the datatable
|
|
|
+ for (let prop in meterKeys2) {
|
|
|
+ this.array2 = [];
|
|
|
+ //let label = localStorage.getItem("email") == "inverlec@grupomerelec.com" ? `INVERLEC ${prop}` : this.metersValues[prop]["label"];
|
|
|
+ let quantity = Object.keys(this.metersValues[0]["data"]);
|
|
|
+ let mvalues = Object.values(this.metersValues[prop]["data"].map(obj => obj).reverse())
|
|
|
|
|
|
- if (mvalues[prop2] != undefined) {
|
|
|
- this.array3.push(mvalues[prop2]["total_energy_kWh"]);
|
|
|
- }
|
|
|
- else {
|
|
|
- this.array3.push(0)
|
|
|
- }
|
|
|
-
|
|
|
- if (+prop == 0){
|
|
|
- this.array2.push(this.array3)
|
|
|
- }
|
|
|
+ for (let prop2 in quantity){
|
|
|
+ // Date insertion
|
|
|
+ this.array3 = [];
|
|
|
+ let columnname = `medidor${prop}`;
|
|
|
|
|
|
- if (+prop != 0) {
|
|
|
- this.array1[prop2].push(this.array3[0]);
|
|
|
+ if (+prop == 0 && mvalues[prop2] != undefined){
|
|
|
+ let dateT = this.getDateWithFormat(this.view, mvalues[prop2]["dateMax"])
|
|
|
+ this.array3.push(dateT);
|
|
|
+ this.array3.push(this.savings_logs_data[prop2]);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (mvalues[prop2] != undefined) {
|
|
|
+ this.array3.push(mvalues[prop2]["total_energy_kWh"]);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.array3.push(0)
|
|
|
+ }
|
|
|
+
|
|
|
+ if (+prop == 0){
|
|
|
+ this.array2.push(this.array3)
|
|
|
+ }
|
|
|
+
|
|
|
+ if (+prop != 0) {
|
|
|
+ this.array1[prop2].push(this.array3[0]);
|
|
|
+ }
|
|
|
}
|
|
|
+ if (+prop == 0){
|
|
|
+ this.array1 = (this.array2)
|
|
|
+ //this.array1 = [].concat.apply([], this.array1)
|
|
|
+ }
|
|
|
}
|
|
|
- if (+prop == 0){
|
|
|
- this.array1 = (this.array2)
|
|
|
- //this.array1 = [].concat.apply([], this.array1)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // According to the selected interval in the option buttons of the chart, the date is given an specific format
|
|
|
- switch (view){
|
|
|
- case "day":
|
|
|
- this.barChartLabels = this.metersValues[0]["data"].map(obj => formatDate(obj.dateMax, 'HH:mm ','es-Es','-0600')).reverse();
|
|
|
- break;
|
|
|
- case 'week':
|
|
|
- this.barChartLabels = this.metersValues[0]["data"].map(obj => formatDate(obj.dateMax, 'EEEE dd','es-Es','-0600')).reverse();
|
|
|
- break;
|
|
|
- case "year":
|
|
|
- this.barChartLabels = this.metersValues[0]["data"].map(obj => formatDate(obj.dateMax, 'MM/yyyy','es-Es','-0600')).reverse();
|
|
|
- break;
|
|
|
- default:
|
|
|
- this.barChartLabels = this.metersValues[0]["data"].map(obj => formatDate(obj.dateMax, 'dd/MM','es-Es','-0600')).reverse();
|
|
|
- }
|
|
|
-
|
|
|
- // Push the values to the chart object
|
|
|
- this.tableData.push({headers: "Fecha/Hora", dataValues: this.barChartLabels})
|
|
|
- this.tableData.reverse()
|
|
|
- for( let v in Object.keys(this.tableData)){
|
|
|
- this.displayedColumns.push(this.tableData[v]["headers"]);
|
|
|
- }
|
|
|
- this.tableData2 = this.array1;
|
|
|
-
|
|
|
- this.dataSource.data = this.tableData2;
|
|
|
- this.dataSource.paginator = this.paginator;
|
|
|
- this.dataSource.sort = this.sort;
|
|
|
-
|
|
|
- this.dataSourcePrint.data = this.tableData2;
|
|
|
|
|
|
+ // According to the selected interval in the option buttons of the chart, the date is given an specific format
|
|
|
+ switch (view){
|
|
|
+ case "day":
|
|
|
+ this.barChartLabels = this.metersValues[0]["data"].map(obj => formatDate(obj.dateMax, 'HH:mm ','es-Es','-0600')).reverse();
|
|
|
+ break;
|
|
|
+ case 'week':
|
|
|
+ this.barChartLabels = this.metersValues[0]["data"].map(obj => formatDate(obj.dateMax, 'EEEE dd','es-Es','-0600')).reverse();
|
|
|
+ break;
|
|
|
+ case "year":
|
|
|
+ this.barChartLabels = this.metersValues[0]["data"].map(obj => formatDate(obj.dateMax, 'MM/yyyy','es-Es','-0600')).reverse();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ this.barChartLabels = this.metersValues[0]["data"].map(obj => formatDate(obj.dateMax, 'dd/MM','es-Es','-0600')).reverse();
|
|
|
+ }
|
|
|
|
|
|
- this.showTable = true;
|
|
|
- this.chart1 = new Chart('canvas', {
|
|
|
- type: this.chart1Type,
|
|
|
- options: {
|
|
|
- title: {
|
|
|
- display: true,
|
|
|
- },
|
|
|
- tooltips: {
|
|
|
- mode: 'index',
|
|
|
- callbacks: {
|
|
|
- // Get the total of the energy produced in every point and show it in the hover tooltip
|
|
|
- label: function (tooltipItem, data) {
|
|
|
- var label = data.datasets[tooltipItem.datasetIndex].label || '';
|
|
|
- var value = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];
|
|
|
- var total = 0;
|
|
|
-
|
|
|
- for (var i = 0; i < data.datasets.length; i++)
|
|
|
- total += +data.datasets[i].data[tooltipItem.index];
|
|
|
-
|
|
|
- if (tooltipItem.datasetIndex !== data.datasets.length - 1) {
|
|
|
- return label + " : " + value;
|
|
|
+ // Push the values to the chart object
|
|
|
+ this.tableData.push({headers: "Ahorro[US$]"});
|
|
|
+ this.tableData.push({headers: "Fecha/Hora", dataValues: this.barChartLabels});
|
|
|
+ this.tableData.reverse()
|
|
|
+ for( let v in Object.keys(this.tableData)){
|
|
|
+ this.displayedColumns.push(this.tableData[v]["headers"]);
|
|
|
+ }
|
|
|
+ this.tableData2 = this.array1;
|
|
|
+
|
|
|
+ this.dataSource.data = this.tableData2;
|
|
|
+ this.dataSource.paginator = this.paginator;
|
|
|
+ this.dataSource.sort = this.sort;
|
|
|
+
|
|
|
+ this.dataSourcePrint.data = this.tableData2;
|
|
|
+
|
|
|
+ this.showTable = true;
|
|
|
+ this.chart1 = new Chart('canvas', {
|
|
|
+ type: this.chart1Type,
|
|
|
+ options: {
|
|
|
+ title: {
|
|
|
+ display: true,
|
|
|
+ },
|
|
|
+ tooltips: {
|
|
|
+ mode: 'index',
|
|
|
+ callbacks: {
|
|
|
+ // Get the total of the energy produced in every point and show it in the hover tooltip
|
|
|
+ label: function (tooltipItem, data) {
|
|
|
+ var label = data.datasets[tooltipItem.datasetIndex].label || '';
|
|
|
+ var value = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];
|
|
|
+ var total = 0;
|
|
|
+
|
|
|
+ for (var i = 1; i < data.datasets.length; i++)
|
|
|
+ total += +data.datasets[i].data[tooltipItem.index];
|
|
|
+
|
|
|
+ if (tooltipItem.datasetIndex !== data.datasets.length - 1) {
|
|
|
+ return label + " : " + value;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return [label + " : " + value, "TOTAL[kWh] : " + Math.round(total)];
|
|
|
+ }
|
|
|
}
|
|
|
- else {
|
|
|
- return [label + " : " + value, "TOTAL : " + Math.round(total)];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ responsive: true,
|
|
|
+ maintainAspectRatio: false,
|
|
|
+ scales: {
|
|
|
+ xAxes: [{
|
|
|
+ stacked: true,
|
|
|
+ barPercentage: 0.7
|
|
|
+ }],
|
|
|
+ yAxes: [
|
|
|
+ {
|
|
|
+ stacked: true,
|
|
|
+ position: "left"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ display: true,
|
|
|
+ stacked: true,
|
|
|
+ position: 'right',
|
|
|
+ id: 'y-axis-ahorro',
|
|
|
+ gridLines: {
|
|
|
+ drawOnChartArea: false
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
+ ]
|
|
|
+ }
|
|
|
},
|
|
|
- responsive: true,
|
|
|
- maintainAspectRatio: false,
|
|
|
- scales: {
|
|
|
- xAxes: [{
|
|
|
- stacked: true,
|
|
|
- barPercentage: 0.7
|
|
|
- }],
|
|
|
- yAxes: [{
|
|
|
- stacked: true
|
|
|
- }]
|
|
|
+
|
|
|
+ data: {
|
|
|
+ labels: this.barChartLabels,
|
|
|
+ datasets: this.metersData,
|
|
|
}
|
|
|
- },
|
|
|
- data: {
|
|
|
- labels: this.barChartLabels,
|
|
|
- datasets: this.metersData,
|
|
|
- },
|
|
|
+ });
|
|
|
+ this.chartjs = true;
|
|
|
});
|
|
|
- this.chartjs = true;
|
|
|
});
|
|
|
setTimeout(()=>{
|
|
|
Swal.close();
|
|
|
@@ -590,9 +637,21 @@ export class AssetsComponent implements OnInit {
|
|
|
stacked: true,
|
|
|
barPercentage: 0.7
|
|
|
}],
|
|
|
- yAxes: [{
|
|
|
- stacked: true
|
|
|
- }]
|
|
|
+ yAxes: [
|
|
|
+ {
|
|
|
+ stacked: true,
|
|
|
+ position: "left"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ display: true,
|
|
|
+ stacked: false,
|
|
|
+ position: 'right',
|
|
|
+ id: 'y-axis-ahorro',
|
|
|
+ gridLines: {
|
|
|
+ drawOnChartArea: false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
data: {
|