Skip to content

Basic Usage

Roman Baitaliuk edited this page Jul 30, 2020 · 4 revisions

Chart Configuration

Declare ChartConfiguration class in your view for all chart modifications.

let config = ChartConfiguration()

Chart data

ChartDataEntry class represents a single entry in the chart with x- and y- coordinate. Prepare an array of entries for adding to the chart.

self.config.data.entries = newEntries

Creating the View

BarChartView(config: self.config)
    .onAppear() {
        self.config.data.entries = self.createEntries()
    }
    .frame(height: 300)

Note: frame is a default SwiftUI view modifier.

Examples

Please see example projects at ~/Examples

Clone this wiki locally