UGTK cat mascotUGTKengine within an engine Request access

UGTK / Toolkit / UIModule / Line Chart

Line Chart Module

Summary

The Line Chart module provides a Canva-like line chart with static layout (no ScrollRect), pan/zoom support, and a custom inspector with data table editor.


Setup

  1. Add Mn_LineChart component to an empty UI GameObject.
  2. The component will auto-create the hierarchy on first use.
  3. Assign or create a SO_LineChartData asset.
  4. Use the custom inspector tabs to edit data and customize.

Quick Start

Create Sample Data: - Menu: UGTK/LineChart/Create Sample Data (Canva Example) - Creates a dataset with Lun..Dom labels and 3 series

Add Chart to Scene: 1. Create empty GameObject under Canvas 2. Add Mn_LineChart component 3. In Inspector → "Dati" tab → Click "Crea Dataset" if needed 4. Assign the dataset 5. Chart auto-rebuilds


Inspector Tabs

Dati Tab: - Data table: Edit X labels and series values - Add/remove series and rows - Toggle series visibility - Live preview updates

Personalizza Tab: - Plot size, gutter size - Grid/axis settings - Point size, line thickness - Y axis range (auto or manual)


Runtime API

// Add point
chart.AddItem(xIndex, yValue, seriesIndex);

// Update point
chart.UpdateItem(xIndex, yValue, seriesIndex);

// Remove point
chart.RemoveItem(xIndex, seriesIndex);

// Set axes
chart.SetAxes(xLabels, yMin, yMax);

// Rebuild
chart.RebuildAll();

Features


File Structure

Runtime: - Mn_LineChart.cs - Main controller - SO_LineChartData.cs - Data asset - Mn_LineChartPoint.cs - Point interaction - Mn_LineChartTooltip.cs - Tooltip display - Mn_LineChartPanZoom.cs - Pan/zoom handler - LineChartPool.cs - Object pooling

Editor: - Mn_LineChartEditor.cs - Canva-like custom inspector - LineChartSampleData.cs - Sample data generator


© 2026 Marcello De Bonis. All rights reserved