PlottableValue
struct · iOS 16.0+ · SDK 27.1
struct PlottableValue<Value> where Value : PlottableLabeled data that you plot in a chart using marks. Provide a `PlottableValue` to a ``Mark`` property (e.g., x, y, foregroundStyle) to plot data values with the mark property. > Important: The data type must conform to ``Plottable``. This is a numeric value like a <doc://com.apple.documentation/documentation/Swift/Double> or <doc://com.apple.documentation/documentation/Swift/Int16> for quantitative data, <doc://com.apple.documentation/documentation/Foundation/Date> for temporal data, or <doc://com.apple.documentation/documentation/Swift/String> for categorical data. You can use the `.value("Category", \.category)` shorthand to create a `PlottableValue`. The example below plots category, value, and group with the bar mark's x, y, and foregroundStyle. ```swift struct Bar { let category: String let value: Double let group: String } let data: [Bar] = [ Bar(category: "A", value: 20, group: "Group 1"), Bar(category: "A", value: 30, group: "Group 2"), Bar(category: "A", value: 10, group: "Group 3"), Bar(category: "B", value: 40, group: "Group 1"), Bar(category: "B", value: 20, group: "Group 2"), Bar(category: "B", value: 10, group: "Group 3"), //... ] var body: some View { Chart(data) { BarMark( x: .value("Category", $0.category), y: .value("Quantity", $0.value) ) .foregroundStyle(.value("Group", $0.group)) } } ```
Members (0)
This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.
Skipped declarations
8 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
PlottableValue.value(_:_:)
The containing type needs Swift generic type arguments. (no canonical witness for Value)
PlottableValue.value(_:_:)
The containing type needs Swift generic type arguments. (no canonical witness for Value)
PlottableValue.value(_:_:)
The containing type needs Swift generic type arguments. (no canonical witness for Value)
PlottableValue.value(_:_:)
The containing type needs Swift generic type arguments. (no canonical witness for Value)
PlottableValue.value(_:_:)
The containing type needs Swift generic type arguments. (no canonical witness for Value)
PlottableValue.value(_:_:)
The containing type needs Swift generic type arguments. (no canonical witness for Value)
PlottableValue.value(_:_:)
The containing type needs Swift generic type arguments. (no canonical witness for Value)
PlottableValue.value(_:_:)
The containing type needs Swift generic type arguments. (no canonical witness for Value)