Skip to content

Expanded Authoring Workflows

Chart Guru can be authored from the Inspector, Gallery, Designer, fluent C#, Swift Charts snippets, and UI Toolkit. The best workflow depends on whether you are exploring a visual idea, building a scene chart, migrating Swift Charts code, or embedding charts into a UI Toolkit application.

These paths share ChartDefinition and the compiled Chart model, so a visual experiment or imported Swift snippet can become a saved scene chart, reusable ChartAsset or generated C#.

Open Tools > Chart Guru > 2D Gallery to browse saved templates by family. Search for the chart's purpose, inspect a card's Swift Charts or Chart Guru badge, then open a copy in the Designer or create it in the scene.

  • Use Search when you know the concept name, such as trend, range, selection, or viewport.
  • Use the family filters to narrow the visual form; grouped, stacked and multi-series configurations have dedicated templates.
  • Choose the grouped, stacked or multi-series template that matches the data, then edit it in the Designer. Gallery previews do not require global multi-series or stacked toggles.
  • Open a gallery card in the Designer when you want to inspect or adapt the exact chart configuration.

Designer Workflow

Open Tools > Chart Guru > Chart Designer for visual chart creation. It edits a serialized ChartDefinition shared with Canvas, world-space and UI Toolkit hosts. Switch compatible families between 2D and 3D with the dimension control; the switch preserves applicable data and settings.

  • Data adapts to the document: Series for simple wide data, Heat Map for grid cells, Candles for OHLC rows, or Table and Layers for complex definitions. The table view preserves mappings that a simplified series editor cannot represent.

Style contains applicable mark, plot and chart appearance controls, including interpolation, opacity and gradients. Bar Width and Height use Mark Sizing. In 3D, the material preset and independent roughness and metalness overrides affect the spatial marks.

  • Axes controls expose domains, scale, tick count, formatting, label orientation, collision behavior, range padding, and origin alignment.
  • Legend sets position and alignment. Actions groups interaction, selection, animation, transitions and output. Inapplicable 2D or 3D options are hidden while their saved values are retained.

Create in Scene places a cloned definition on a suitable chart host. Apply to Selection updates selected hosts; when a shared ChartAsset is involved, choose whether to edit it or make the host unique. Save as Asset creates a reusable ChartAsset. C# and Swift panels stay current while visible; review the Swift export notes for features that cannot be represented.

Swift Charts Import and Parsing

Paste supported Swift Chart or Chart3D code into the Designer or a chart Inspector. Examples/04_Workflows/Swift Import provides concrete source and imported charts. The importer accepts Swift member casing such as foregroundStyle and chartLegend, then generates idiomatic PascalCase C#.

Chart Designer code panels with generated Chart Guru C# above the Swift source and the Paste Swift and Copy Swift buttons.
The Designer keeps the Swift code and generated C# visible after the pasted chart is loaded.

This makes the wider Swift Charts ecosystem a practical source of ideas: paste supported chart-focused code, inspect the translated result, and continue in idiomatic Chart Guru C#. Diagnostics keep partial or unsupported constructs visible rather than pretending that arbitrary Swift application logic can be converted automatically.

Chart Guru documentation screenshot
Swift Charts import parses supported marks, literal data, modifiers, axes, legends, and diagnostics, then produces Designer state and C#.
  • Supported input is chart-focused Swift code with concrete marks and extractable literal data. Dynamic app logic should be translated manually or stubbed before import.
  • Supported concepts include common marks, foreground style, gradients, symbols, stacking, legends, axis visibility and formatting, scroll position, visible domains, date units, annotations, reference rules, trendline ideas, function plots, and vectorized typed plot helpers.
  • Diagnostics explain unsupported or partially supported constructs so the converted result can be reviewed instead of silently misrepresenting the original chart.
  • Generated code keeps the Swift mark structure as close as practical while using idiomatic Chart Guru C# names and avoiding unnecessary default modifiers.

Advanced Swift Example Concepts

Use the Swift Import workflow and its source files as a concept atlas. Inspect layered marks, custom axes, overlays, data loops, scales, functions and vectorized plots, then import the closest supported structure and review the result and diagnostics.

  • Layer marks: combine AreaMark, LineMark, PointMark, RectangleMark, and RuleMark so gradients, peaks, thresholds, and selections describe the same data.
  • Compose axes: translate top/bottom X axes, leading/trailing Y axes, custom labels, grid lines, and labelled bands into ChartXAxis, ChartYAxis, and axis builder calls.
  • Use overlays: pair chartOverlay and ChartProxy patterns with RuleMark, lollipop symbols, and annotations for tap or drag inspection.
  • Encode dense data: use foreground style, symbol size, opacity, interpolation, stacking, start/end ranges, function plots, and vectorized typed plots to carry extra dimensions without adding separate charts.
  • Refine custom Swift ideas: snippets with app-specific ChartSymbolShape code are useful starting points; translate the chart structure first, then finish the symbol, mark, function/vectorized plot, or renderer customization in Chart Guru.

Supported Swift Constructs and Modifiers

Marks: BarMark, LineMark, AreaMark, PointMark, RectangleMark, RuleMark, SectorMark, candlestick/range concepts, and composed mark groups.

Data input: concrete Chart(data), ForEach and supported enumerated or nested loops, plus extractable vectorized plot data. Computed application data that cannot be evaluated is reported rather than replaced with invented sample values.

Encodings and modifiers: x/y/start/end channels, foreground style, symbol, symbol size, opacity, interpolation, line style, corner radius, gradients, and legends.

Axes and scales: X, Y and 3D Z scale types, explicit or extractable domains and ranges, axis positions, marks, grid lines, ticks, labels and title alignment. As in Swift Charts, the first scale modifier for an axis takes precedence; combine its domain, range and type in that call.

Analysis and interaction: reference rules, annotations, chartOverlay/ChartProxy patterns, lollipop inspection, accessibility labels/values, trendline/regression concepts, mathematical function plots, and vectorized typed plot helpers.

Chart Guru documentation screenshot
Advanced Chart Guru concepts: scatter/bubble encodings, composed marks, custom scales, mathematical function plots, and vectorized typed plots.

UI Toolkit Designer and UXML Authoring

Use ChartGuruElement for 2D UI Toolkit charts and Chart3DElement for spatial chart images. Both accept definitions, chart and data assets, sources and code-built charts. UIToolkitChartBinder connects a named chart element in a UIDocument or compatible PanelRenderer to scene content.

  • Use Assets > Create > Chart Guru > UXML Chart Template for a 2D starter, or the 3D UXML Chart Template for a Chart3DElement.
  • UXML supplies chart and data asset references on supported Unity versions, or chart-type for the element's inline definition. Configure titles, axes, labels, legends, interaction and animation in the ChartAsset or edit the element's Definition in code and call Rebuild(). Use the binder for asset references on older Unity versions.
  • Use USS for surrounding layout and UI composition. Chart rendering itself comes from ChartGuruElement and the shared Chart Guru renderer.
  • Study the UI Toolkit examples for imperative setup, asset-backed data, scene data source, runtime updates, streaming data and host-specific update APIs, interaction, theming, advanced axes, and external data source binding.