From 8be123bf3a183098be79f263b2dd059999d4b5bd Mon Sep 17 00:00:00 2001 From: Kazgatari <56477241+Kazgatari@users.noreply.github.com> Date: Sat, 1 Aug 2026 18:00:21 +0200 Subject: [PATCH] changed hardcoded values to theme --- .../author-category-pie.component.ts | 6 ++++++ .../person-company-connections.component.ts | 8 +++---- ...tegory-year-aggregation-chart.component.ts | 21 ++++++++++++++++--- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/webapp/src/app/modules/compare-authors/author-research-profile/author-category-pie.component.ts b/webapp/src/app/modules/compare-authors/author-research-profile/author-category-pie.component.ts index a2a24b75..8b35e9cf 100644 --- a/webapp/src/app/modules/compare-authors/author-research-profile/author-category-pie.component.ts +++ b/webapp/src/app/modules/compare-authors/author-research-profile/author-category-pie.component.ts @@ -82,11 +82,17 @@ export class AuthorCategoryPieComponent { const textColor = this.cssColor('--sg-text', '#0f172a'); const mutedColor = this.cssColor('--sg-text-muted', '#64748b'); + const tooltipBg = this.cssColor('--sg-card-bg', '#ffffff'); + const tooltipBorder = this.cssColor('--sg-border', '#dde5f2'); + return { animation: false, tooltip: { trigger: 'item', formatter: '{b}: {c} Publikationen ({d} %)', + backgroundColor: tooltipBg, + borderColor: tooltipBorder, + textStyle: { color: textColor }, }, graphic: { type: 'text', diff --git a/webapp/src/app/modules/person-company-connections/person-company-connections.component.ts b/webapp/src/app/modules/person-company-connections/person-company-connections.component.ts index 0194c0a6..83afefad 100644 --- a/webapp/src/app/modules/person-company-connections/person-company-connections.component.ts +++ b/webapp/src/app/modules/person-company-connections/person-company-connections.component.ts @@ -372,7 +372,7 @@ export class PersonCompanyConnectionsComponent implements OnInit { show: true, position: 'bottom', fontWeight: 700, - color: '#07163d', + color: 'var(--sg-text)', }, }, ]; @@ -400,7 +400,7 @@ export class PersonCompanyConnectionsComponent implements OnInit { label: { show: true, position: 'bottom', - color: '#07163d', + color: 'var(--sg-text)', width: 125, overflow: 'truncate', }, @@ -443,7 +443,7 @@ export class PersonCompanyConnectionsComponent implements OnInit { label: { show: true, position: 'bottom', - color: '#07163d', + color: 'var(--sg-text)', width: 110, overflow: 'truncate', fontSize: 11, @@ -506,7 +506,7 @@ export class PersonCompanyConnectionsComponent implements OnInit { itemHeight: 20, selectedMode: false, textStyle: { - color: '#3f4659', + color: 'var(--sg-text-muted)', fontSize: 13, fontWeight: 500, }, diff --git a/webapp/src/app/shared/ui/primary-category-year-aggregation-chart/primary-category-year-aggregation-chart.component.ts b/webapp/src/app/shared/ui/primary-category-year-aggregation-chart/primary-category-year-aggregation-chart.component.ts index 09ad9ccf..d349748c 100644 --- a/webapp/src/app/shared/ui/primary-category-year-aggregation-chart/primary-category-year-aggregation-chart.component.ts +++ b/webapp/src/app/shared/ui/primary-category-year-aggregation-chart/primary-category-year-aggregation-chart.component.ts @@ -1,4 +1,4 @@ -import { Component, computed, input } from '@angular/core'; +import { Component, computed, inject, input } from '@angular/core'; import { PrimaryCategoryYearAggregation, PrimaryCategoryYearAggregationPage, @@ -8,6 +8,7 @@ import { transformWorkPrimaryCategory } from '../../pipes/work-primary-category. import { AppInfoCardComponent } from '../app-info-card/app-info-card.component'; import { EChartsCoreOption } from 'echarts'; import { NgxEchartsDirective } from 'ngx-echarts'; +import { ChartThemeService } from '../../services/chart-theme.service'; type CardInput = { value: string; @@ -22,6 +23,7 @@ type CardInput = { styleUrl: './primary-category-year-aggregation-chart.component.scss', }) export class PrimaryCategoryYearAggregationChartComponent { + private readonly chartTheme = inject(ChartThemeService); page = input.required(); countPrimaryCategoryForAllYears( @@ -116,8 +118,15 @@ export class PrimaryCategoryYearAggregationChartComponent { }); buildChartOptions(data: PrimaryCategoryYearAggregation[]): EChartsCoreOption { + const c = this.chartTheme.colors(); return { - tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } }, + tooltip: { + trigger: 'axis', + axisPointer: { type: 'shadow' }, + backgroundColor: c.tooltipBg, + borderColor: c.tooltipBorder, + textStyle: { color: c.textColor }, + }, legend: { data: [ this.basicResearchLabel, @@ -127,6 +136,7 @@ export class PrimaryCategoryYearAggregationChartComponent { ], bottom: 0, itemGap: 40, + textStyle: { color: c.textColor }, }, grid: { left: '3%', @@ -138,8 +148,13 @@ export class PrimaryCategoryYearAggregationChartComponent { xAxis: { type: 'category', data: data.map((d) => d.publication_year.toString()), + axisLabel: { color: c.textColor }, + }, + yAxis: { + type: 'value', + axisLabel: { color: c.textColor }, + splitLine: { lineStyle: { color: c.splitLine } }, }, - yAxis: { type: 'value' }, series: [ { name: this.basicResearchLabel,