Build Your First Chart
Inspector Path: No Code
Use the Inspector path for a dashboard, HUD, prototype or designer-owned chart. The host keeps an inline ChartDefinition or references a reusable ChartAsset; its definition controls marks, channels, axes, styling and interaction. A data asset, inline table or data source supplies the rows.
- Use MockChartDataSource for instant generated data.
- Use the chart's Data table or a ChartDataAsset for directly authored rows. ManualChartDataSource remains useful when component code or an existing scene owns editable points, series and reference rules.
- Use file or web data sources when a chart should follow CSV, JSON, Google Sheets, HTTP, Yahoo Finance, or high-throughput live samples.
Reusable Definitions and Data
A ChartAsset stores a reusable chart definition; a ChartDataAsset stores a reusable typed table. Assign them in the chart's Data and header controls, or keep the definition and table inline. Editing a shared chart asset changes its users; Make Unique gives a host its own inline copy.
SetChart(chart) displays a code-built Chart without saving it. SetData(frame) temporarily overrides the data used by a definition. ClearChart() and ClearData() restore the saved content. In Play Mode, editing a host's Definition creates its own copy of an assigned ChartAsset. Call Rebuild() after code edits, or SetDirty() to refresh on the next update.
Code Path: Full Control
Use the code path when chart data is produced by gameplay, simulation, analytics, editor tooling, or custom runtime systems.
using ChartGuru;
using UnityEngine;
public sealed class MonthlySalesChart : MonoBehaviour
{
private ChartGraphic _graphic;
private void Start()
{
float[] values = { 65f, 89f, 45f, 78f, 92f, 55f };
string[] labels = { "Jan", "Feb", "Mar", "Apr", "May", "Jun" };
ChartBuilder builder = Chart.Create();
for (int i = 0; i < values.Length; i++)
{
BarMark bar = new BarMark(i, values[i])
.CornerRadius(8f)
.ForegroundStyle(PlottableValue.Value("Month", labels[i]));
bar.CategoryLabel = labels[i];
builder.Add(bar);
}
Chart chart = builder
.ChartTitle("Monthly Sales")
.ChartSubtitle("Current fiscal year")
.ChartXAxis(x => x.Label("Month"))
.ChartYAxis(y => y.Label("Sales").TickFormat("F0"))
.ChartLegend(LegendPosition.Hidden)
.Animation(ChartGuru.Animation.Default.Delay(0.05f))
.Build();
_graphic = ChartCanvasHelper.RenderToRectTransform(
chart, GetComponent<RectTransform>(), true, "Monthly Sales");
}
private void OnDestroy()
{
ChartCanvasHelper.RemoveChart(_graphic);
}
}
Horizontal Bars
Horizontal bars are not a separate ChartType. They are regular BarMark data with horizontal orientation. In the Inspector, use Bar Orientation. In code, either assign BarLayout.Horizontal explicitly or bind a numeric X value with a categorical Y value as shown below.

BarMark bar = new BarMark(
PlottableValue.Value("Sales", value),
PlottableValue.Value("Category", "Long category name"))
.CornerRadius(6f);