---
title: PlottableValue
framework: charts
role: symbol
role_heading: Structure
path: charts/plottablevalue
---

# PlottableValue

Labeled data that you plot in a chart using marks.

## Declaration

```swift
struct PlottableValue<Value> where Value : Plottable
```

## Overview

Overview 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 Double or Int16 for quantitative data, Date for temporal data, or 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. 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))     } }

## Topics

### Type Methods

- [value(_:_:)](charts/plottablevalue/value(_:_:)-13lvv.md)
- [value(_:_:)](charts/plottablevalue/value(_:_:)-3sze5.md)
- [value(_:_:)](charts/plottablevalue/value(_:_:)-4qa4d.md)
- [value(_:_:)](charts/plottablevalue/value(_:_:)-6jxfn.md)
- [value(_:_:)](charts/plottablevalue/value(_:_:)-6p2ls.md)
- [value(_:_:)](charts/plottablevalue/value(_:_:)-70xhu.md)
- [value(_:_:)](charts/plottablevalue/value(_:_:)-7ciwx.md)
- [value(_:_:)](charts/plottablevalue/value(_:_:)-7ed58.md)
- [value(_:_:)](charts/plottablevalue/value(_:_:)-7k0m0.md)
- [value(_:_:)](charts/plottablevalue/value(_:_:)-8bsvd.md)
- [value(_:_:)](charts/plottablevalue/value(_:_:)-9bdsw.md)
- [value(_:_:)](charts/plottablevalue/value(_:_:)-f1kk.md)
- [value(_:_:unit:calendar:)](charts/plottablevalue/value(_:_:unit:calendar:)-1rtpi.md)
- [value(_:_:unit:calendar:)](charts/plottablevalue/value(_:_:unit:calendar:)-2r0fo.md)
- [value(_:_:unit:calendar:)](charts/plottablevalue/value(_:_:unit:calendar:)-8f7fe.md)
- [value(_:_:unit:calendar:)](charts/plottablevalue/value(_:_:unit:calendar:)-liyc.md)

## See Also

### Labeled data

- [Plottable](charts/plottable.md)
