TimelineKit

Theming & Localization

Built-in Themes

The histogram ships with four built-in themes. Set the theme via settings.theme.

LightHistogramThemeClean light theme (default). White background with subtle grid lines.
DarkHistogramThemeDark theme with a dark background, suitable for dark-mode UIs.
ModernHistogramThemeModern theme with default base styling.
ClassicHistogramThemeClassic flat-color style with no gradients and no border radius.
import { LightHistogramTheme, DarkHistogramTheme,
         ClassicHistogramTheme } from '@timelinekit/core';

// Apply a theme
histogram.settings.theme = new DarkHistogramTheme();

// Create and customize a theme
const theme = new LightHistogramTheme();
theme.rowHeight = 80;
theme.histogram.barBorderRadius = 3;
histogram.settings.theme = theme;

Histogram Style Properties

Each theme contains a histogram property of type HistogramStyle with bar and area chart colors:

HistogramStyle

normalColor1: stringGradient start color for bars within capacity.
normalColor2: stringGradient end color for bars within capacity.
overAllocatedColor1: stringGradient start color for bars exceeding capacity.
overAllocatedColor2: stringGradient end color for bars exceeding capacity.
thresholdLineColor: stringColor of the capacity threshold line.
thresholdLineWidth: numberWidth of the threshold line in pixels. Default: 1.
thresholdLineStyle: string'solid' | 'dashed' | 'dotted'. Default: 'dashed'.
barBorderRadius: numberBorder radius of histogram bars. Default: 1.
scaleFactor: numberScale factor — 1.5 means 100% capacity = 2/3 of row height. Default: 1.5.
areaColor: stringFill color for area mode (normal utilization).
areaLineColor: stringStroke color for area mode line (normal).
areaOverAllocatedColor: stringFill color for area mode (over-allocated region).
areaOverAllocatedLineColor: stringStroke color for area mode line (over-allocated).
// Customize bar colors
const theme = new LightHistogramTheme();
theme.histogram.normalColor1 = '#88bbee';
theme.histogram.normalColor2 = '#5588cc';
theme.histogram.overAllocatedColor1 = '#ee8888';
theme.histogram.overAllocatedColor2 = '#cc5555';
theme.histogram.scaleFactor = 1.2; // bars fill more of the row
histogram.settings.theme = theme;

For comprehensive theming documentation covering sheet, chart header, grid lines, tooltips, and more, see the Theming & Styles guide.

Localization

Set the locale to change the language of the histogram UI — column headers, tooltips, and date formatting.

import { deLocale } from '@timelinekit/core';

// Use a built-in locale
histogram.settings.locale = deLocale;

// Or customize specific histogram strings
const locale = { ...deLocale };
locale.histogram = {
  ...deLocale.histogram,
  resource: 'Ressource',
  utilization: 'Auslastung',
  capacity: 'Kapazität',
  peak: 'Spitze',
  aggregate: 'Gesamt',
  date: 'Datum',
};
histogram.settings.locale = locale;

For the full list of available locales and customization options, see the Localization guide.