Bentrock Charts are designed to work with the data provided in json
format. It uses the same data format for rendering different types of charts, additional customizations can also be applied based on the needs.
- Xcode 11 and above
- Swift 5
- XCFramework
- iPhone and Simulator
- Line Chart (Multi legend)
- Bar Chart (Multi legend)
- Donut Chart (Multi legend)
Copy the BentrockCharts.xcframework
to your project and import the module wherever needed. Initialize the view by providing the json and add it as a subView.
var lineChartView = LineChartView(json: jsonData)
This view can be used like a normal UIView
. The above line of code initializes line chart with default settings. Additional customizations can be done to the charts by providing the LineChartSettings
object along with the initialization. The chart picks random colors for rendering the legends if no colors are provided in the colorsArray
of the settign object.
Customizations can be done by providing Settings
Object along with the initialization.
var lineChartSettings = LineChartSettings()
lineChartSettings.showGrid = false
lineChartSettings.showLegends = false
lineChartSettings.colorsArray = [UIColor.red, .green, .blue]
let lineChartView = LineChartView(json: jsonData, settings: lineChartSettings)
- Line Chart - colors for legends, show grid, show legends, show axis labels, show axis title
- Bar Chart (Multi legend) - colors for legends, show grid, show legends, show axis labels, show axis title
- Donut Chart (Multi legend) - colors for legends, show legends, every segment automatically select a different gradient of the legent color.