Skip to content

ChartTheme

ClassChartGuruChartGuru
public class ChartTheme : ScriptableObject

Reusable visual defaults for chart backgrounds, axes, grids, labels, marks, and series palettes.

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 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 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 ChartGuru.ChartTheme.OnThemeModified for the given theme. Call this from editor code that modifies a theme outside of OnValidate.

Parameters

Name Type
theme ChartGuru.ChartTheme
public float GetTextScaleFactor(Vector2 chartSize)

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

Parameters

Name Type
chartSize UnityEngine.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

Name Type
chartSize UnityEngine.Vector2
position ChartGuru.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

Name Type
index System.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

Name Type
index System.Int32
brightness System.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

Name Type
seriesIndex System.Int32

Returns

UnityEngine.Color

public ChartTheme Clone()

Creates an independent copy of this Chart Theme; later configuration changes do not affect the original instance.

Returns

ChartGuru.ChartTheme

public ChartTheme()

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 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}