Closed kintela closed 2 months ago
Hi
I have a component where I am going to embed several graphics
...` <app-grafica [title]="'Costes y Horas'" [type]="'ColumnChart'" [data]="dataHorasCostesOfertas" [columns]="chartHorasCostesOfertasColumns" [options]="options"> ... <app-grafica [title]="'Ofertas Presentadas y Adjudicadas'" [type]="'ColumnChart'" [data]="dataPorcentajeAdjudicadas" [columns]="chartPorcentajeAdjudicadasColumns" [options]="options">
chartPorcentajeAdjudicadasColumns = ['Año', 'Presentadas', 'Adjudicadas']; chartHorasCostesOfertasColumns = ['Año', 'Horas', 'Costes'];
options={ hAxis: { title: 'Años', }, vAxis: { minValue: 0, }, legend: { position: 'top' } `
then I have this graficaComponent
`
import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';
@Component({ selector: 'app-grafica', templateUrl: './grafica.component.html', styleUrls: ['./grafica.component.scss'] }) export class GraficaComponent implements OnInit, OnChanges { @Input() title: string; @Input() type: string; @Input() origen: string; @Input() data: any[][]; @Input() columns: string[]; @Input() options: any;
constructor() { } ngOnChanges(changes: SimpleChanges): void { console.log('GraficaComponent-ngOnChanges-data', this.data); } ngOnInit(): void { } }
` But nothing is shown, no error appears and the graphic component receives the data correctly
Any idea, please?
Thanks
I'll close this since it's quite old already. I hope you managed to resolve this in the meantime!
Hi
I have a component where I am going to embed several graphics
...` <app-grafica [title]="'Costes y Horas'" [type]="'ColumnChart'" [data]="dataHorasCostesOfertas" [columns]="chartHorasCostesOfertasColumns" [options]="options"> ... <app-grafica [title]="'Ofertas Presentadas y Adjudicadas'" [type]="'ColumnChart'" [data]="dataPorcentajeAdjudicadas" [columns]="chartPorcentajeAdjudicadasColumns" [options]="options">
chartPorcentajeAdjudicadasColumns = ['Año', 'Presentadas', 'Adjudicadas']; chartHorasCostesOfertasColumns = ['Año', 'Horas', 'Costes'];
options={ hAxis: { title: 'Años', }, vAxis: { minValue: 0, }, legend: { position: 'top' } `
then I have this graficaComponent
`
import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';
@Component({ selector: 'app-grafica', templateUrl: './grafica.component.html', styleUrls: ['./grafica.component.scss'] }) export class GraficaComponent implements OnInit, OnChanges { @Input() title: string; @Input() type: string; @Input() origen: string; @Input() data: any[][]; @Input() columns: string[]; @Input() options: any;
constructor() { } ngOnChanges(changes: SimpleChanges): void { console.log('GraficaComponent-ngOnChanges-data', this.data); } ngOnInit(): void { } }
` But nothing is shown, no error appears and the graphic component receives the data correctly
Any idea, please?
Thanks