---
title: "foregroundStyle(by:)"
framework: charts
role: symbol
role_heading: Instance Method
path: "charts/chartcontent/foregroundstyle(by:)"
---

# foregroundStyle(by:)

Represents data using a foreground style.

## Declaration

```swift
nonisolated func foregroundStyle<D>(by value: PlottableValue<D>) -> some ChartContent where D : Plottable

```

## Parameters

- `value`: The data value to encode using foreground style.

## Mentioned in

Creating a chart using Swift Charts

## See Also

### Encoding data into mark characteristics

- [lineStyle(by:)](charts/chartcontent/linestyle(by:).md)
- [position(by:axis:span:)](charts/chartcontent/position(by:axis:span:).md)
- [symbol(by:)](charts/chartcontent/symbol(by:).md)
- [symbolSize(by:)](charts/chartcontent/symbolsize(by:).md)
