changed hardcoded values to theme

This commit is contained in:
Kazgatari
2026-08-01 18:00:21 +02:00
parent 570da1b47c
commit 8be123bf3a
3 changed files with 28 additions and 7 deletions
@@ -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',
@@ -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,
},
@@ -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<PrimaryCategoryYearAggregationPage>();
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,