data-visualization/DSLineChart

DSLineChart

data-visualization
since v2.0

Animated 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

PropTypeDefaultDescription
datareq[DSChartDataPoint]โ€”Array of (label, value) pairs.
tintColorDSColor.primaryLine and gradient colour.
showGridBooltrueShows horizontal grid lines.
showTooltipBooltrueEnables long-press tooltip.
heightCGFloat200Chart 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
)

Related Components