Skip to main content

Class: ChartConfigService

Defined in: src/services/chartConfig.ts:194

Chart Configuration Service for theme-aware chart styling.

Remarksโ€‹

Centralizes all chart configurations to ensure consistency and maintainability across the application. The service automatically applies theme colors, fonts, and spacing to all chart configurations.

Constructorsโ€‹

Constructorโ€‹

new ChartConfigService(theme: Theme): ChartConfigService

Defined in: src/services/chartConfig.ts:205

Creates a new chart configuration service.

Parametersโ€‹

themeโ€‹

Theme

Theme instance containing colors, typography, and spacing

Returnsโ€‹

ChartConfigService

Propertiesโ€‹

themeโ€‹

private readonly theme: Theme

Defined in: src/services/chartConfig.ts:196

Current theme instance for styling configuration

Methodsโ€‹

getBarChartConfig()โ€‹

getBarChartConfig(): ChartOptions<"bar">

Defined in: src/services/chartConfig.ts:217

eslint-disable @typescript-eslint/no-unsafe-type-assertion -- Safe: Chart.js configuration object type assertions

Returnsโ€‹

ChartOptions<"bar">


getDoughnutChartConfig()โ€‹

getDoughnutChartConfig(totalChecks: number): ChartOptions<"doughnut">

Defined in: src/services/chartConfig.ts:245

Uptime doughnut chart configuration

Parametersโ€‹

totalChecksโ€‹

number

Total number of checks for percentage calculation

Returnsโ€‹

ChartOptions<"doughnut">

Chart configuration options for doughnut charts


getLineChartConfig()โ€‹

getLineChartConfig(): ChartOptions<"line">

Defined in: src/services/chartConfig.ts:290

Response time line chart configuration

Returnsโ€‹

ChartOptions<"line">

Chart configuration options for line charts with responsive scaling


getAxisTitle()โ€‹

private getAxisTitle(text: string): AxisTitleConfig

Defined in: src/services/chartConfig.ts:341

Get common axis title configuration

Parametersโ€‹

textโ€‹

string

The text to display in the axis title

Returnsโ€‹

AxisTitleConfig

Configured axis title object with theme-aware styling


getBaseConfig()โ€‹

private getBaseConfig(): Partial<ChartOptions>

Defined in: src/services/chartConfig.ts:362

Get base configuration shared across all chart types.

Returnsโ€‹

Partial<ChartOptions>

Partial chart options with common styling and behavior

Remarksโ€‹

Provides consistent foundation for all charts including responsive behavior, theme-aware colors, typography, and tooltip styling. This configuration is extended by specific chart type methods.

This is an internal method used by other configuration methods.


getBaseScale()โ€‹

private getBaseScale(): BaseScaleConfig

Defined in: src/services/chartConfig.ts:394

Get base scale configuration with theme-aware styling

Returnsโ€‹

BaseScaleConfig

Base scale configuration object for axes


getChartFont()โ€‹

private getChartFont(size: number, weight: string): ChartFontConfig

Defined in: src/services/chartConfig.ts:417

Get common font configuration used across charts

Parametersโ€‹

sizeโ€‹

number = 12

Font size in pixels (default: 12)

weightโ€‹

string = "normal"

Font weight (default: "normal")

Returnsโ€‹

ChartFontConfig

Font configuration object with theme-aware family


getChartTitle()โ€‹

private getChartTitle(text: string): ChartTitleConfig

Defined in: src/services/chartConfig.ts:432

Get common title configuration for charts

Parametersโ€‹

textโ€‹

string

The text to display in the chart title

Returnsโ€‹

ChartTitleConfig

Configured chart title object with theme-aware styling