ChartDefinition
public sealed class ChartDefinitionThe 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.
Remarks
Section titled “Remarks”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.
Constructors
Section titled “Constructors”
ChartDefinition()
Section titled “ChartDefinition()”public ChartDefinition()Creates an empty bar chart definition.
ChartDefinition(ChartType)
Section titled “ChartDefinition(ChartType)”public ChartDefinition(ChartType type)Creates an empty definition of the given type.
Parameters
| Name | Type |
|---|---|
type |
ChartGuru.ChartType |
Methods
Section titled “Methods”
AddLayer(ChartLayer)
Section titled “AddLayer(ChartLayer)”public ChartDefinition AddLayer(ChartLayer layer)Appends a layer and returns this definition for chaining.
Parameters
| Name | Type |
|---|---|
layer |
ChartGuru.ChartLayer |
Returns
ChartGuru.ChartDefinition
WithData(ChartDataTable)
Section titled “WithData(ChartDataTable)”public ChartDefinition WithData(ChartDataTable data)Replaces the default data and returns this definition for chaining.
Parameters
| Name | Type |
|---|---|
data |
ChartGuru.ChartDataTable |
Returns
ChartGuru.ChartDefinition
Retarget(ChartType)
Section titled “Retarget(ChartType)”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 |
Clone()
Section titled “Clone()”public ChartDefinition Clone()Returns a deep copy that shares only the theme asset.
Returns
ChartGuru.ChartDefinition
Properties
Section titled “Properties”
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
Layers
Section titled “Layers”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
Legend
Section titled “Legend”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
Scales
Section titled “Scales”public ChartScaleSettings Scales { get; }Colors and symbols assigned to series or category values.
Returns
ChartGuru.ChartScaleSettings
Background
Section titled “Background”public ChartBackgroundSettings Background { get; }Chart background that replaces the theme's.
Returns
ChartGuru.ChartBackgroundSettings
PlotStyle
Section titled “PlotStyle”public PlotStyleConfig PlotStyle { get; set; }Plot area background, border and padding.
Returns
ChartGuru.PlotStyleConfig
Border
Section titled “Border”public ChartBorderConfig Border { get; set; }Border around the whole chart.
Returns
ChartGuru.ChartBorderConfig
BarWidth
Section titled “BarWidth”public MarkDimension BarWidth { get; set; }Default bar width for every bar layer.
Returns
ChartGuru.MarkDimension
BarHeight
Section titled “BarHeight”public MarkDimension BarHeight { get; set; }Default bar height for horizontal bar layers.
Returns
ChartGuru.MarkDimension
Interaction
Section titled “Interaction”public ChartInteractionSettings Interaction { get; }Selection, hover, viewport and tooltip behavior.
Returns
ChartGuru.ChartInteractionSettings
Animation
Section titled “Animation”public ChartAnimationSettings Animation { get; }Data animation, entry animation and morph style.
Returns
ChartGuru.ChartAnimationSettings
Spatial
Section titled “Spatial”public ChartSpatialSettings Spatial { get; }Camera pose, projection and proportions of 3D charts.
Returns
ChartGuru.ChartSpatialSettings
IsThreeDimensional
Section titled “IsThreeDimensional”public bool IsThreeDimensional { get; }True when the type is drawn in three dimensions.
Returns
System.Boolean