Skip to content

Commit 12c5bd7

Browse files
committed
charts updated
1 parent 4b21ba5 commit 12c5bd7

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
2-
<p-chart
1+
<div *ngIf="draw == 0">
2+
No ha jugado ningún partido todavía
3+
</div>
4+
<p-chart *ngIf="draw != 0"
35
type="doughnut"
46
[data]="data"
57
[options]="chartOptions"
68
width="250px"
79
height="250px"
8-
></p-chart>
10+
>
11+
12+
</p-chart>
13+
914

frontend/src/app/components/doughnutchart/doughnutchart.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export class DoughnutChartComponent {
1313
data: any;
1414

1515
chartOptions: any;
16+
draw: number;
1617

1718

1819

@@ -27,13 +28,15 @@ export class DoughnutChartComponent {
2728
let user = response as User;
2829

2930
console.log(user);
31+
this.draw = user.numLoses+user.numWins;
32+
3033

3134
this.data = {
3235
labels: ['Victorias','Derrotas'],
3336
datasets: [
3437
{
35-
// Delete "+1" when fix the 0-0 chart error
36-
data: [user.numWins+1, user.numLoses ],
38+
39+
data: [user.numWins, user.numLoses ],
3740
backgroundColor: [
3841
"#67d400",
3942
"#121212",

0 commit comments

Comments
 (0)