data-visualization/DSLineChart
DSLineChart
data-visualizationAnimated line chart with a gradient fill, interactive tooltip on long-press, and configurable axes.
iOS 17+macOS 14+
Purpose
Trend visualisation in analytics dashboards.
Interactive Reference
Live showroom
Need the full visual surface?
Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().
Best for exploring:
variants, states, categories, and real app examples in one place.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| datareq | [DSChartDataPoint] | โ | Array of (label, value) pairs. |
| tint | Color | DSColor.primary | Line and gradient colour. |
| showGrid | Bool | true | Shows horizontal grid lines. |
| showTooltip | Bool | true | Enables long-press tooltip. |
| height | CGFloat | 200 | Chart height. |
Examples
Revenue trend
7-day revenue line chart.
swift
DSLineChart(
data: [
DSChartDataPoint(label: "Mon", value: 42000),
DSChartDataPoint(label: "Tue", value: 51000),
DSChartDataPoint(label: "Wed", value: 47000),
DSChartDataPoint(label: "Thu", value: 63000),
DSChartDataPoint(label: "Fri", value: 58000),
DSChartDataPoint(label: "Sat", value: 71000),
DSChartDataPoint(label: "Sun", value: 82000),
],
tint: DSColor.primary,
height: 220
)