Skip to content

ChartDefinition

ClassChartGuruChartGuru
public sealed class ChartDefinition

The serializable description of a chart: its type, data, mark layers, axes, legend, text, appearance, interaction, animation and 3D view. Every host, inspector, the Designer, the galleries, the Swift importer and the code generator read and write this one model.

ChartDefinitionCompiler turns a definition, plus optional data from a source, into the runtime Chart through the public builder. Charts built in code with Chart.Create() stay runtime objects; delegates such as formatters or surface closures belong there and are never part of a definition.

public ChartDefinition()

Creates an empty bar chart definition.

public ChartDefinition(ChartType type)

Creates an empty definition of the given type.

Parameters

Name Type
type ChartGuru.ChartType

public ChartDefinition AddLayer(ChartLayer layer)

Appends a layer and returns this definition for chaining.

Parameters

Name Type
layer ChartGuru.ChartLayer

Returns

ChartGuru.ChartDefinition

public ChartDefinition WithData(ChartDataTable data)

Replaces the default data and returns this definition for chaining.

Parameters

Name Type
data ChartGuru.ChartDataTable

Returns

ChartGuru.ChartDefinition

public void Retarget(ChartType type)

Changes the chart type and moves the layers drawn with the old type's default mark, such as the bars of a bar chart, to the new type's mark. Layers with other marks, like rules, keep theirs.

Parameters

Name Type
type ChartGuru.ChartType
public ChartDefinition Clone()

Returns a deep copy that shares only the theme asset.

Returns

ChartGuru.ChartDefinition

public ChartType Type { get; set; }

Chart family. 3D families are drawn by the Chart Guru 3D add-on.

Returns

ChartGuru.ChartType

public ChartTheme Theme { get; set; }

Theme asset, or null for the default theme.

Returns

ChartGuru.ChartTheme

public Vector2 Size { get; set; }

Logical size for previews and texture output.

Returns

UnityEngine.Vector2

public ChartDataTable Data { get; set; }

Default or sample data.

Returns

ChartGuru.ChartDataTable

public List<ChartLayer> Layers { get; }

Mark layers in draw order.

Returns

System.Collections.Generic.List{ChartGuru.ChartLayer}

public ChartTextSettings Text { get; }

Titles, axis and data labels, and label colors.

Returns

ChartGuru.ChartTextSettings

public LegendConfig Legend { get; set; }

Legend position, alignment and size.

Returns

ChartGuru.LegendConfig

public AxisConfig XAxis { get; set; }

Horizontal axis.

Returns

ChartGuru.AxisConfig

public AxisConfig YAxis { get; set; }

Vertical axis.

Returns

ChartGuru.AxisConfig

public AxisConfig ZAxis { get; set; }

Depth axis of 3D charts.

Returns

ChartGuru.AxisConfig

public ChartScaleSettings Scales { get; }

Colors and symbols assigned to series or category values.

Returns

ChartGuru.ChartScaleSettings

public ChartBackgroundSettings Background { get; }

Chart background that replaces the theme's.

Returns

ChartGuru.ChartBackgroundSettings

public PlotStyleConfig PlotStyle { get; set; }

Plot area background, border and padding.

Returns

ChartGuru.PlotStyleConfig

public ChartBorderConfig Border { get; set; }

Border around the whole chart.

Returns

ChartGuru.ChartBorderConfig

public MarkDimension BarWidth { get; set; }

Default bar width for every bar layer.

Returns

ChartGuru.MarkDimension

public MarkDimension BarHeight { get; set; }

Default bar height for horizontal bar layers.

Returns

ChartGuru.MarkDimension

public ChartInteractionSettings Interaction { get; }

Selection, hover, viewport and tooltip behavior.

Returns

ChartGuru.ChartInteractionSettings

public ChartAnimationSettings Animation { get; }

Data animation, entry animation and morph style.

Returns

ChartGuru.ChartAnimationSettings

public ChartSpatialSettings Spatial { get; }

Camera pose, projection and proportions of 3D charts.

Returns

ChartGuru.ChartSpatialSettings

public bool IsThreeDimensional { get; }

True when the type is drawn in three dimensions.

Returns

System.Boolean