Skip to content

IChartHost

InterfaceChartGuruChartGuru
public interface IChartHost

Contract shared by every chart host (ChartGraphic, ChartGuruElement and the 3D add-on's components): a ChartDefinition or a ChartAsset plus bound data compile into the runtime IChartHost.Chart, and code can replace either at runtime without touching saved state.

void SetChart(Chart chart)

Shows a chart built in code instead of the definition until it is set to null. Not saved.

Parameters

NameType
chartChartGuru.Chart
void SetData(ChartDataFrame data, bool shapeChanged = true)

Shows data instead of the bound data until it is set to null. Not saved. Pass shapeChanged false when data keeps the columns, row count and categories of the data shown, such as a moved level or new readings of the same grid: the host then updates the values of its marks in place where its compiler can, and rebuilds otherwise.

Parameters

NameType
dataChartGuru.ChartDataFrame
shapeChangedSystem.Boolean
void Rebuild()

Recompiles the chart from the definition and its data now.

void SetDirty()

Recompiles the chart from the definition and its data on the next update.

void ReplayEntryAnimation(Animation? animation = null)

Replays the chart’s entry animation with animation, or with the definition’s own.

Parameters

NameType
animationSystem.Nullable{ChartGuru.Animation}

Chart Chart { get; }

The runtime chart being drawn.

Returns

ChartGuru.Chart

ChartHostContent Content { get; }

What the host shows: an inline definition or a chart asset, plus bound data.

Returns

ChartGuru.ChartHostContent

ChartDefinition Definition { get; }

The definition to read or edit. In Play Mode a host that uses a chart asset returns its own copy, so runtime edits never change the asset. Call IChartHost.Rebuild() after editing it.

Returns

ChartGuru.ChartDefinition

bool HasRuntimeChart { get; }

True while a chart set from code with IChartHost.SetChart(Chart) replaces the definition.

Returns

System.Boolean

bool IsShowingPreviewData { get; }

True while the host draws generated preview data because it has no data of its own; editor only.

Returns

System.Boolean