resolveTheme
resolveTheme(
theme?):Theme
Defined in: core/themes.ts:112
Resolve a theme reference into the concrete Theme object the chart will use for drawing. Accepts:
- A registered theme name (
'midnight','arctic', a name passed to addTheme, …). Unknown names fall back tomidnight. - An inline Theme object. Missing semantic fields
(
positive/negative/onAccent) are backfilled from sensible defaults so partial themes don’t render withundefinedcolours. undefined— returns the defaultmidnighttheme.
Parameters
Section titled “Parameters”theme?
Section titled “theme?”Theme name, inline theme object, or omitted.
Returns
Section titled “Returns”The resolved Theme, never undefined.
Example
Section titled “Example”resolveTheme('arctic'); // built-inresolveTheme({ bg: '#000', ... }); // inline (semantics backfilled)resolveTheme(); // → midnight (default)