Core conceptsStylingThemes· 4 min read
Theming & Visual Customization
Built-in color presets (Dark, Light, Midnight, Matrix), CSS custom properties, and runtime theme switching.
QuaCharts features a comprehensive styling engine that coordinates background fills, plot areas, gridlines, axis text typography, and multi-series color palettes. It supports instant theme switching at runtime without rebuilding chart instances.
Built-in Theme Presets
| Theme Name | Background | Gridline Style | Target Aesthetics |
|---|---|---|---|
| midnight | #0b0f19 (Deep Obsidian) | #1e293b (Subtle Navy) | Modern crypto and fintech trading desks (Default) |
| dark | #121212 (Charcoal) | #262626 (Neutral Gray) | SaaS analytics dashboards & developer consoles |
| light | #ffffff (Pure White) | #f1f5f9 (Soft Slate) | Enterprise reporting, print view, and white-label client portals |
| matrix | #050a07 (Terminal Black) | #132e1b (Phosphor Green) | Algorithmic trading monitoring and security telemetry |
| monochrome | #18181b (High Contrast) | #3f3f46 (Silver) | Accessibility-first and Bloomberg-style compact terminals |
Applying and Switching Themes
Set the theme at initialization or switch dynamically using chart.setTheme():
theme-switching.ts
1
import { createLineChart } from '@quatick/web-charts';
2
3
const chart = createLineChart('#chart', {
4
theme: 'midnight', // Initial preset
5
title: 'Portfolio Net Asset Value',
6
series: [{ name: 'Fund Alpha', data }],
7
});
8
9
// Switch dynamically when user toggles dark/light mode
10
document.getElementById('theme-toggle')?.addEventListener('click', () => {
11
const nextTheme = document.documentElement.classList.contains('dark') ? 'midnight' : 'light';
12
chart.setTheme(nextTheme);
13
});
Custom Palette Overrides
You can pass a custom palette array of hex codes or CSS variables to match your corporate brand identity:
custom-palette.ts
1
chart.update({
2
colors: [
3
'#38bdf8', // Series 0: Sky Cyan
4
'#a855f7', // Series 1: Royal Purple
5
'#10b981', // Series 2: Emerald Green
6
'#f59e0b', // Series 3: Amber Gold
7
'#ef4444', // Series 4: Crimson
8
],
9
plotOptions: {
10
series: {
11
lineWidth: 2.5,
12
animation: { duration: 400, easing: 'easeOutQuart' },
13
},
14
},
15
});