Skip to content
Snippets Groups Projects
Commit 65baeddf authored by ramoncalabozo's avatar ramoncalabozo
Browse files

Grafico con datos de prueba funcionando

parent 4b115209
No related branches found
No related tags found
No related merge requests found
<h1> Visualización de las publicaciones de revistas por universidad </h1>
<app-line-chart></app-line-chart>
\ No newline at end of file
<p>line-chart works!</p>
<div class="container mt-5 pt-5">
<div class="col-12">
<div class="row">
<div class="col-5 pl-5 mt-5">
<h1>Line Chart</h1>
<br>
<h3>Shufle Data</h3>
<br>
<button class= "btn btn-outline-primary" (click)="shuffeData()">Shuffle</button>
</div>
<div class="col-5">
<div class="chart-wrapper">
<canvas baseChart
[datasets]="lineChartData"
[options]="lineChartOptions"
[legend]="lineChartLegend"
[plugins]="lineChartPlugins"
[labels]="lineChartLabels">
</canvas>
</div>
</div>
</div>
</div>
</div>
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { ChartDataset, ChartConfiguration} from 'chart.js';
import { NgChartsModule } from 'ng2-charts';
@Component({
selector: 'app-line-chart',
templateUrl: './line-chart.component.html',
styleUrls: ['./line-chart.component.css']
})
export class LineChartComponent {
export class LineChartComponent implements OnInit{
lineChartData: ChartDataset[] = [ // Datos
{ data: [12, 72, 78, 75, 17, 75], label: 'Crude oil prices' },
{ data: [85, 12, 28, 85, 17, 75], label: 'Another crud' }
];
lineChartLabels = ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio'];
lineChartOptions = { responsive: true, };
lineChartLegend = true;
lineChartPlugins = [];
lineChartType = 'line';
constructor() {}
ngOnInit():void {
}
shuffeData() {
this.lineChartData = [ // Datos
{ data: [12, 72, 78, 75, 17, 75], label: 'Crude oil prices' },
{ data: [85, 12, 28, 85, 17, 75], label: 'Another crud' }
];
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment