ChartTheme
public class ChartTheme : ScriptableObjectReusable visual defaults for chart backgrounds, axes, grids, labels, marks, and series palettes.
Fields
Section titled “Fields”
BackgroundMode
Section titled “BackgroundMode”public ChartBackgroundMode BackgroundModeReturns
ChartGuru.ChartBackgroundMode
BackgroundColor
Section titled “BackgroundColor”public Color BackgroundColorReturns
UnityEngine.Color
BackgroundGradient
Section titled “BackgroundGradient”public LinearGradientStyle BackgroundGradientReturns
ChartGuru.LinearGradientStyle
BackgroundFourCorner
Section titled “BackgroundFourCorner”public FourCornerGradient BackgroundFourCornerReturns
ChartGuru.FourCornerGradient
PlotAreaMode
Section titled “PlotAreaMode”public ChartBackgroundMode PlotAreaModeReturns
ChartGuru.ChartBackgroundMode
PlotAreaColor
Section titled “PlotAreaColor”public Color PlotAreaColorReturns
UnityEngine.Color
PlotAreaGradient
Section titled “PlotAreaGradient”public LinearGradientStyle PlotAreaGradientReturns
ChartGuru.LinearGradientStyle
PlotAreaFourCorner
Section titled “PlotAreaFourCorner”public FourCornerGradient PlotAreaFourCornerReturns
ChartGuru.FourCornerGradient
SeriesColors
Section titled “SeriesColors”public Color[] SeriesColorsReturns
UnityEngine.Color[]
AxisLineColor
Section titled “AxisLineColor”public Color AxisLineColorReturns
UnityEngine.Color
GridLineColor
Section titled “GridLineColor”public Color GridLineColorReturns
UnityEngine.Color
TextColor
Section titled “TextColor”public Color TextColorReturns
UnityEngine.Color
public Font FontReturns
UnityEngine.Font
LabelFontSize
Section titled “LabelFontSize”public int LabelFontSizeReturns
System.Int32
DataLabelFontSize
Section titled “DataLabelFontSize”public int DataLabelFontSizeReturns
System.Int32
TitleFontSize
Section titled “TitleFontSize”public int TitleFontSizeReturns
System.Int32
LegendFontSize
Section titled “LegendFontSize”public int LegendFontSizeReturns
System.Int32
LabelFontStyle
Section titled “LabelFontStyle”public FontStyle LabelFontStyleReturns
UnityEngine.FontStyle
DataLabelFontStyle
Section titled “DataLabelFontStyle”public FontStyle DataLabelFontStyleReturns
UnityEngine.FontStyle
TitleFontStyle
Section titled “TitleFontStyle”public FontStyle TitleFontStyleReturns
UnityEngine.FontStyle
LegendFontStyle
Section titled “LegendFontStyle”public FontStyle LegendFontStyleReturns
UnityEngine.FontStyle
ChartTitleFontSize
Section titled “ChartTitleFontSize”public int ChartTitleFontSizeReturns
System.Int32
ChartSubtitleFontSize
Section titled “ChartSubtitleFontSize”public int ChartSubtitleFontSizeReturns
System.Int32
ChartTitleFontStyle
Section titled “ChartTitleFontStyle”public FontStyle ChartTitleFontStyleReturns
UnityEngine.FontStyle
ChartSubtitleFontStyle
Section titled “ChartSubtitleFontStyle”public FontStyle ChartSubtitleFontStyleReturns
UnityEngine.FontStyle
LegendItemSpacing
Section titled “LegendItemSpacing”public float LegendItemSpacingReturns
System.Single
LegendSymbolSize
Section titled “LegendSymbolSize”public float LegendSymbolSizeReturns
System.Single
MinTextScaleFactor
Section titled “MinTextScaleFactor”public float MinTextScaleFactorReturns
System.Single
MaxTextScaleFactor
Section titled “MaxTextScaleFactor”public float MaxTextScaleFactorReturns
System.Single
AxisLineWidth
Section titled “AxisLineWidth”public float AxisLineWidthReturns
System.Single
GridLineWidth
Section titled “GridLineWidth”public float GridLineWidthReturns
System.Single
BarSpacing
Section titled “BarSpacing”public float BarSpacingReturns
System.Single
EnableShadows
Section titled “EnableShadows”public bool EnableShadowsReturns
System.Boolean
ShadowColor
Section titled “ShadowColor”public Color ShadowColorReturns
UnityEngine.Color
ShadowOffset
Section titled “ShadowOffset”public Vector2 ShadowOffsetReturns
UnityEngine.Vector2
ShadowBlur
Section titled “ShadowBlur”public float ShadowBlurReturns
System.Single
EnableGlow
Section titled “EnableGlow”public bool EnableGlowReturns
System.Boolean
GlowIntensity
Section titled “GlowIntensity”public float GlowIntensityReturns
System.Single
Methods
Section titled “Methods”
RaiseOnThemeModified(ChartTheme)
Section titled “RaiseOnThemeModified(ChartTheme)”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 |
GetTextScaleFactor(Vector2)
Section titled “GetTextScaleFactor(Vector2)”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
GetSeriesColor(int)
Section titled “GetSeriesColor(int)”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
GetSeriesColorVariant(int, float)
Section titled “GetSeriesColorVariant(int, float)”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
GetAreaFillColor(int)
Section titled “GetAreaFillColor(int)”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
Clone()
Section titled “Clone()”public ChartTheme Clone()Creates an independent copy of this Chart Theme; later configuration changes do not affect the original instance.
Returns
ChartGuru.ChartTheme
Constructors
Section titled “Constructors”
ChartTheme()
Section titled “ChartTheme()”public ChartTheme()Properties
Section titled “Properties”
EffectiveMinTextScaleFactor
Section titled “EffectiveMinTextScaleFactor”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
EffectiveMaxTextScaleFactor
Section titled “EffectiveMaxTextScaleFactor”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
Default
Section titled “Default”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
Events
Section titled “Events”
OnThemeModified
Section titled “OnThemeModified”public static event Action<ChartTheme> OnThemeModifiedFired 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}