IChartHost
public interface IChartHostContract 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.
Methods
Section titled “Methods”
SetChart(Chart)
Section titled “SetChart(Chart)”void SetChart(Chart chart)Shows a chart built in code instead of the definition until it is set to null. Not saved.
Parameters
| Name | Type |
|---|---|
chart | ChartGuru.Chart |
SetData(ChartDataFrame, bool)
Section titled “SetData(ChartDataFrame, bool)”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
| Name | Type |
|---|---|
data | ChartGuru.ChartDataFrame |
shapeChanged | System.Boolean |
Rebuild()
Section titled “Rebuild()”void Rebuild()Recompiles the chart from the definition and its data now.
SetDirty()
Section titled “SetDirty()”void SetDirty()Recompiles the chart from the definition and its data on the next update.
ReplayEntryAnimation(Animation?)
Section titled “ReplayEntryAnimation(Animation?)”void ReplayEntryAnimation(Animation? animation = null)Replays the chart’s entry animation with animation, or with the definition’s own.
Parameters
| Name | Type |
|---|---|
animation | System.Nullable{ChartGuru.Animation} |
Properties
Section titled “Properties”
Chart Chart { get; }The runtime chart being drawn.
Returns
ChartGuru.Chart
Content
Section titled “Content”ChartHostContent Content { get; }What the host shows: an inline definition or a chart asset, plus bound data.
Returns
ChartGuru.ChartHostContent
Definition
Section titled “Definition”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
HasRuntimeChart
Section titled “HasRuntimeChart”bool HasRuntimeChart { get; }True while a chart set from code with IChartHost.SetChart(Chart) replaces the definition.
Returns
System.Boolean
IsShowingPreviewData
Section titled “IsShowingPreviewData”bool IsShowingPreviewData { get; }True while the host draws generated preview data because it has no data of its own; editor only.
Returns
System.Boolean