---
title: BarPlot
framework: charts
role: symbol
role_heading: Structure
path: charts/barplot
---

# BarPlot

Chart content that represents a collection of data using bars.

## Declaration

```swift
struct BarPlot<Content>
```

## Overview

Overview Use BarPlot when you want to visualize data in the same way as with BarMark, but you want to visualize an entire data collection with a single plot. You can initialize and style the plot with simple values or key paths. Add modifiers with KeyPath before adding modifiers with simple values. BarPlot(     votes,     x: .value("Party", \.party),     y: .value("Vote count", \.voteCount) ) .foregroundStyle(by: \.partyShapeStyle) .cornerRadius(4)

## Topics

### Plotting bars from a collection

- [init(_:x:y:width:height:stacking:)](charts/barplot/init(_:x:y:width:height:stacking:).md)
- [init(_:x:yStart:yEnd:width:)](charts/barplot/init(_:x:ystart:yend:width:).md)
- [init(_:x:yStart:yEnd:width:stacking:)](charts/barplot/init(_:x:ystart:yend:width:stacking:)-2mtih.md)
- [init(_:x:yStart:yEnd:width:stacking:)](charts/barplot/init(_:x:ystart:yend:width:stacking:)-680hw.md)
- [init(_:xStart:xEnd:y:height:stacking:)](charts/barplot/init(_:xstart:xend:y:height:stacking:)-16tou.md)
- [init(_:xStart:xEnd:y:height:stacking:)](charts/barplot/init(_:xstart:xend:y:height:stacking:)-2x0yx.md)
- [init(_:xStart:xEnd:y:height:)](charts/barplot/init(_:xstart:xend:y:height:).md)
- [init(_:xStart:xEnd:yStart:yEnd:)](charts/barplot/init(_:xstart:xend:ystart:yend:)-48su5.md)
- [init(_:xStart:xEnd:yStart:yEnd:)](charts/barplot/init(_:xstart:xend:ystart:yend:)-862wn.md)
- [init(_:xStart:xEnd:yStart:yEnd:)](charts/barplot/init(_:xstart:xend:ystart:yend:)-mtdv.md)
- [init(_:xStart:xEnd:yStart:yEnd:)](charts/barplot/init(_:xstart:xend:ystart:yend:)-raqh.md)

### Supporting types

- [body](charts/chartcontent/body-swift.property.md)
- [VectorizedBarPlotContent](charts/vectorizedbarplotcontent.md)

## Relationships

### Conforms To

- [ChartContent](charts/chartcontent.md)
- [Copyable](swift/copyable.md)
- [Escapable](swift/escapable.md)
- [VectorizedChartContent](charts/vectorizedchartcontent.md)

## See Also

### Vectorized plots

- [Creating a data visualization dashboard with Swift Charts](charts/creating-a-data-visualization-dashboard-with-swift-charts.md)
- [AreaPlot](charts/areaplot.md)
- [LinePlot](charts/lineplot.md)
- [PointPlot](charts/pointplot.md)
- [RectanglePlot](charts/rectangleplot.md)
- [RulePlot](charts/ruleplot.md)
- [SectorPlot](charts/sectorplot.md)
- [VectorizedChartContent](charts/vectorizedchartcontent.md)
