Skip to content

ChartTheme

ClassChartGuruChartGuru
public class ChartTheme : ScriptableObject

Reusable visual defaults for chart backgrounds, axes, grids, labels, marks and series palettes, shared by 2D and 3D charts, plus the ChartTheme.Appearance3D block that Chart Guru 3D reads for lighting, materials and the rest of its 3D look.

public ChartBackgroundMode BackgroundMode

Returns

ChartGuru.ChartBackgroundMode

public Color BackgroundColor

Returns

UnityEngine.Color

public LinearGradientStyle BackgroundGradient

Returns

ChartGuru.LinearGradientStyle

public FourCornerGradient BackgroundFourCorner

Returns

ChartGuru.FourCornerGradient

public ChartBackgroundMode PlotAreaMode

Returns

ChartGuru.ChartBackgroundMode

public Color PlotAreaColor

Returns

UnityEngine.Color

public LinearGradientStyle PlotAreaGradient

Returns

ChartGuru.LinearGradientStyle

public FourCornerGradient PlotAreaFourCorner

Returns

ChartGuru.FourCornerGradient

public Color[] SeriesColors

Returns

UnityEngine.Color[]

public Color AxisLineColor

Returns

UnityEngine.Color

public Color GridLineColor

Returns

UnityEngine.Color

public Color TextColor

Returns

UnityEngine.Color

public Font Font

Returns

UnityEngine.Font

public Object FontAsset

Font asset for Canvas and world-space chart labels, which render TextMeshPro font assets. The reference is host-neutral, like ChartTextOptions.FontAsset, so the theme stays independent of the text framework that renders it; the inspector offers only TextMeshPro font assets.

Returns

UnityEngine.Object

public int LabelFontSize

Returns

System.Int32

public int DataLabelFontSize

Returns

System.Int32

public int TitleFontSize

Returns

System.Int32

public int LegendFontSize

Returns

System.Int32

public FontStyle LabelFontStyle

Returns

UnityEngine.FontStyle

public FontStyle DataLabelFontStyle

Returns

UnityEngine.FontStyle

public FontStyle TitleFontStyle

Returns

UnityEngine.FontStyle

public FontStyle LegendFontStyle

Returns

UnityEngine.FontStyle

public int ChartTitleFontSize

Returns

System.Int32

public int ChartSubtitleFontSize

Returns

System.Int32

public FontStyle ChartTitleFontStyle

Returns

UnityEngine.FontStyle

public FontStyle ChartSubtitleFontStyle

Returns

UnityEngine.FontStyle

public bool OverrideChartTitleColor

Returns

System.Boolean

public Color ChartTitleColor

Returns

UnityEngine.Color

public float LegendItemSpacing

Returns

System.Single

public float LegendSymbolSize

Returns

System.Single

public float MinTextScaleFactor

Returns

System.Single

public float MaxTextScaleFactor

Returns

System.Single

public float AxisLineWidth

Returns

System.Single

public float GridLineWidth

Returns

System.Single

public float BarSpacing

Returns

System.Single

public bool EnableShadows

Returns

System.Boolean

public Color ShadowColor

Returns

UnityEngine.Color

public Vector2 ShadowOffset

Returns

UnityEngine.Vector2

public float ShadowBlur

Returns

System.Single

public bool EnableGlow

Returns

System.Boolean

public float GlowIntensity

Returns

System.Single

public static void RaiseOnThemeModified(ChartTheme theme)

Raises ChartTheme.OnThemeModified for the given theme. Call this from editor code that modifies a theme outside of OnValidate.

Parameters

NameType
themeChartGuru.ChartTheme
public float GetTextScaleFactor(Vector2 chartSize)

Calculates the text scale factor for a given chart size using this theme’s scale limits.

Parameters

NameType
chartSizeUnityEngine.Vector2

Returns

System.Single

GetContentScaleFactor(Vector2, LegendPosition)

Section titled “GetContentScaleFactor(Vector2, LegendPosition)”
public float GetContentScaleFactor(Vector2 chartSize, LegendPosition position)

Calculates a content scale factor for a given chart size and legend position using this theme’s scale limits. For top/bottom legends, only width matters; for leading/trailing, only height. Used for legend, symbols, and other content.

Parameters

NameType
chartSizeUnityEngine.Vector2
positionChartGuru.LegendPosition

Returns

System.Single

public Color GetSeriesColor(int index)

Returns the palette color at a wrapping series index, or generates a distinct HSV color when the palette is empty.

Parameters

NameType
indexSystem.Int32

Returns

UnityEngine.Color

public Color GetSeriesColorVariant(int index, float brightness)

Returns a palette color with its HSV brightness multiplied and clamped, preserving hue and saturation.

Parameters

NameType
indexSystem.Int32
brightnessSystem.Single

Returns

UnityEngine.Color

public Color GetAreaFillColor(int seriesIndex)

Returns the resolved series color with alpha set to 0.3 for an area fill.

Parameters

NameType
seriesIndexSystem.Int32

Returns

UnityEngine.Color

public ChartTheme Clone()

Creates an independent copy of this Chart Theme, its 3D appearance included; later configuration changes do not affect the original instance.

Returns

ChartGuru.ChartTheme

public ChartTheme()

public Object TextFont { get; }

Font object handed to chart text: ChartTheme.FontAsset when one is assigned, otherwise ChartTheme.Font. Canvas labels can only render TextMeshPro font assets, so ChartTheme.Font alone leaves them on the TMP default.

Returns

UnityEngine.Object

public float EffectiveMinTextScaleFactor { get; }

Gets the effective minimum text scale factor. Negative values = no limit (returns 0). Zero = use default. Positive = use that value.

Returns

System.Single

public float EffectiveMaxTextScaleFactor { get; }

Gets the effective maximum text scale factor. Negative values = no limit (returns very large value). Zero = use default. Positive = use that value.

Returns

System.Single

public ChartTheme3D Appearance3D { get; set; }

The 3D look read by Chart Guru 3D: studio lights, ambient light and environment, materials, surface color maps, 3D strokes, labels and the shadow plane. Palette, typography, background and axis, grid and text colors come from this theme’s shared settings. 2D charts ignore it. Never null.

Returns

ChartGuru.ChartTheme3D

public static ChartTheme Default { get; }

Returns

ChartGuru.ChartTheme

public static ChartTheme Dark { get; }

Dark theme inspired by Apple’s Swift Charts dark-mode palette. Near-black backgrounds, light text, muted axis/grid lines, and a lightened series palette tuned for legibility on dark backgrounds.

Returns

ChartGuru.ChartTheme

public static event Action<ChartTheme> OnThemeModified

Fired in the Editor (edit mode and play mode) whenever any ChartTheme asset is modified via the Inspector. The argument is the theme that changed. Subscribe to this event to automatically refresh any chart that uses the theme.

Returns

System.Action{ChartGuru.ChartTheme}