charts-3d

Swift Charts 3D visualization with Chart3D container, SurfacePlot for 3D surface rendering from functions or data, Chart3DPose for viewing angle control (predefined poses and custom azimuth/inclination), Chart3DSurfaceStyle for gradient coloring, interactive rotation via @State binding, axis customization (labels, gridlines, value ranges), and visionOS volumetric rendering. Use when building data visualization with 3D surfaces, scientific plots, or immersive chart experiences.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "charts-3d" with this command: npx skills add makgunay/claude-swift-skills/makgunay-claude-swift-skills-charts-3d

Swift Charts — 3D Visualization

Basic 3D Surface Plot

import SwiftUI
import Charts

struct Surface3DView: View {
    var body: some View {
        Chart3D {
            SurfacePlot(x: "X", y: "Y", z: "Z") { x, y in
                sin(x) * cos(y)
            }
        }
    }
}

Custom Viewing Angle

@State private var pose: Chart3DPose = .default

Chart3D {
    SurfacePlot(x: "X", y: "Y", z: "Z") { x, y in sin(x) * cos(y) }
}
.chart3DPose(pose)

// Predefined poses: .default, .front, .back, .top, .bottom, .left, .right
// Custom pose:
Chart3DPose(azimuth: .degrees(45), inclination: .degrees(30))

Interactive Rotation

struct InteractiveChart: View {
    @State private var pose: Chart3DPose = .default

    var body: some View {
        Chart3D {
            SurfacePlot(x: "X", y: "Y", z: "Z") { x, y in sin(x) * cos(y) }
        }
        .chart3DPose($pose)  // Bind for user interaction (drag to rotate)
    }
}

Surface Styling

Chart3D {
    SurfacePlot(x: "X", y: "Y", z: "Height") { x, y in
        sin(x) * cos(y)
    }
    .foregroundStyle(
        .linearGradient(
            colors: [.blue, .green, .yellow, .red],
            startPoint: .bottom, endPoint: .top
        )
    )
}
.chart3DSurfaceStyle(.wireframe)         // Wireframe only
.chart3DSurfaceStyle(.solid)             // Solid surface
.chart3DSurfaceStyle(.solidWithEdges)    // Solid + wireframe overlay

Axis Customization

Chart3D {
    SurfacePlot(x: "Longitude", y: "Latitude", z: "Elevation") { x, y in
        elevation(at: x, y)
    }
}
.chartXAxisLabel("Longitude")
.chartYAxisLabel("Latitude")
.chartZAxisLabel("Elevation (m)")
.chartXScale(domain: -180...180)
.chartYScale(domain: -90...90)

From Data Points

struct DataPoint3D: Identifiable {
    var x: Double, y: Double, z: Double
    var id = UUID()
}

Chart3D(dataPoints) { point in
    // Mark3D or other 3D mark types
}

visionOS Volumetric Window

// visionOS only — renders chart as volumetric object
WindowGroup {
    Chart3D { SurfacePlot(x: "X", y: "Y", z: "Z") { x, y in sin(x) * cos(y) } }
}
.windowStyle(.volumetric)
.defaultSize(width: 0.5, height: 0.5, depth: 0.5, in: .meters)

References

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

macos-permissions

No summary provided by upstream source.

Repository SourceNeeds Review
General

macos-app-structure

No summary provided by upstream source.

Repository SourceNeeds Review
General

swiftui-core

No summary provided by upstream source.

Repository SourceNeeds Review
General

liquid-glass

No summary provided by upstream source.

Repository SourceNeeds Review