Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved visibility #402

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export abstract class CustomChartComponent implements OnInit {
//fillSeriesColor: true,
style: {
fontFamily: 'Roboto',
},
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {DarkModeService} from "../../../services/notifications/dark-mode.service
import {UserSessionService} from "../../../services/user-session.service";
import {ApexTheme} from "ng-apexcharts/lib/model/apex-types";

type GaugeChartOptions = {
export type GaugeChartOptions = {
series: number[];
colors: string [];
labels: string[];
Expand Down Expand Up @@ -66,13 +66,13 @@ export class GaugeChartComponent extends CustomChartComponent {
this.chartOptions = {
colors: this.colors,
chart: this.getChart('radialBar', this.width, this.height, this.shadow, this.showToolbar),
series: this.data?.getValues(),
labels: this.data?.getLabels(),
series: this.data!.getValues(),
labels: this.data!.getLabels(),
fill: this.getFill(this.fill, this.opacity),
plotOptions: this.getPlotOptions(),
tooltip: this.getTooltip(),
title: this.getTitle(this.title, this.titleAlignment),
theme:this.getTheme()
theme: this.getTheme()
};
}

Expand Down Expand Up @@ -102,7 +102,10 @@ export class GaugeChartComponent extends CustomChartComponent {
value: {
show: true,
offsetY: -15,
fontSize: "12px"
fontSize: "12px",
formatter: function (value: number): string {
return value.toFixed(2) + "%"
}
}
},
hollow: {
Expand All @@ -112,7 +115,7 @@ export class GaugeChartComponent extends CustomChartComponent {
}
}

update(data: GaugeChartData) {
update(data: GaugeChartData): void {
this.chart.updateSeries(data.getData());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {Component, Input, ViewChild} from '@angular/core';

import {
ApexChart,
ApexFill, ApexGrid,
ApexFill,
ApexLegend,
ApexNonAxisChartSeries,
ApexResponsive,
Expand Down Expand Up @@ -89,8 +89,18 @@ export class PieChartComponent extends CustomChartComponent {
return undefined;
}

update(data: PieChartData) {
update(data: PieChartData): void {
this.chart.updateSeries(data.getData());
}

protected override getTooltip(): ApexTooltip {
return {
theme: 'dark',
//fillSeriesColor: true,
style: {
fontFamily: 'Roboto',
}
}
}

}
2 changes: 1 addition & 1 deletion frontend/src/app/utils/dates/date-conversor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function convertSeconds(seconds: number | undefined): string {
}

export function convertDate(pipe: DatePipe, date: Date | undefined): string | null {
if (date) {
if (date && new Date(date).getFullYear() > 2000) {
return pipe.transform(date, 'short');
}
return "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ export class TournamentStatisticsComponent extends RbacBasedComponent implements
if (tournamentStatistics.tournamentFightStatistics?.fightsFinishedAt && tournamentStatistics.tournamentFightStatistics?.fightsStartedAt &&
tournamentStatistics.tournamentFightStatistics?.fightsFinishedAt && tournamentStatistics.tournamentFightStatistics?.fightsStartedAt) {
//Time in minutes.
times = [this.getLabel(tournamentStatistics.tournamentName), truncate((new Date(tournamentStatistics.tournamentFightStatistics.fightsFinishedAt).getTime() -
new Date(tournamentStatistics.tournamentFightStatistics.fightsStartedAt).getTime()) / (1000 * 60), 2)];
times = [this.getLabel(tournamentStatistics.tournamentName), Math.max(0, truncate((new Date(tournamentStatistics.tournamentFightStatistics.fightsFinishedAt).getTime() -
new Date(tournamentStatistics.tournamentFightStatistics.fightsStartedAt).getTime()) / (1000 * 60), 2))];
} else {
times = [this.getLabel(tournamentStatistics.tournamentName), 0];
}
Expand Down Expand Up @@ -303,8 +303,8 @@ export class TournamentStatisticsComponent extends RbacBasedComponent implements
let times: [string, number];
if (tournamentStatistics.tournamentFinishedAt && tournamentStatistics.tournamentCreatedAt) {
//Time in minutes.
times = [this.getLabel(tournamentStatistics.tournamentName), truncate((new Date(tournamentStatistics.tournamentFinishedAt).getTime() -
new Date(tournamentStatistics.tournamentCreatedAt).getTime()) / (1000 * 60), 2)];
times = [this.getLabel(tournamentStatistics.tournamentName), Math.max(0, truncate((new Date(tournamentStatistics.tournamentFinishedAt).getTime() -
new Date(tournamentStatistics.tournamentCreatedAt).getTime()) / (1000 * 60), 2))];
} else {
times = [this.getLabel(tournamentStatistics.tournamentName), 0];
}
Expand Down
Loading