View Built-in Xcode Documentation for FLCharts
mainYou can access the full FLCharts documentation directly within Xcode:
- Go to
Product -> Build Documentation. - Once the build finishes, the documentation will be available for browsing.
repository·main·Indexed 43 days ago
https://github.com/francescoleoni98/flchartsA customizable Swift library for building bar, line, pie, radar, and scatter charts for iOS. Features include animations, custom highlighting views, embedded chart cards, and support for various data protocols such as SinglePlotable, MultiPlotable, ScatterPlotable, and FLPiePlotable.
You can access the full FLCharts documentation directly within Xcode:
Product -> Build Documentation.To install FLCharts using Swift Package Manager (SPM):
File -> Add Packages....https://github.com/francescoleoni98/FLCharts and click Add Package.Add Package again.To install FLCharts using Carthage:
Cartfile:github "francescoleoni98/FLCharts"2. Run `carthage update`.
3. In Xcode, go to **Build Phases** and click the plus button to create a **New Run Script Phase**.
4. In the **Run Script > Shell script** window, add: `/usr/local/bin/carthage copy-frameworks`.
5. In the **Run Script > Input file** window, add: `$(SRCROOT)/Carthage/Build/iOS/FLCharts.framework`.
6. Go to `$project_dir/Carthage/Build/iOS` and drag the `FLCharts.framework` folder into your **Xcode Project > Your Target > Frameworks, Libraries and Embedded Content**.
To install FLCharts using CocoaPods, add the following line to your Podfile:
pod 'FLCharts'Then, run pod install in your terminal.
When initializing an FLChart of type .bar, you can specify which prebuilt bar cell class to use.
Available classes:
FLPlainChartBarFLMultipleValuesChartBarFLHorizontalMultipleValuesChartBar// Example of initializing a bar chart with a specific bar class
FLChart(data: ..., type: .bar(bar: FLMultipleValuesChartBar.self))FLCharts is highly customizable via the .config property. You can modify properties such as axes labels using FLAxisLabelConfig and assigning it to a ChartConfig object.
let axisLabelConfig = FLAxisLabelConfig(color: .black,
font: .preferredFont(forTextStyle: .body))
chart.config = ChartConfig(axesLabels: axisLabelConfig)FLCharts supports various chart types, each requiring specific data protocols:
| Chart Type | Bar/Cell Class | Data Protocol |
|---|---|---|
| Plain Bar Chart | FLPlainChartBar | SinglePlotable |
| Multi Value Bar Chart | FLMultipleValuesChartBar | MultiPlotable |
| Horizontal Multi Value Bar Chart | FLHorizontalMultipleValuesChartBar | MultiPlotable |
| Line Chart | N/A | SinglePlotable |
| Multi Value Line Chart | N/A | MultiPlotable |
| Scatter Chart | N/A | ScatterPlotable |
| Radar Chart | N/A | FLDataSet |
| Pie Chart | N/A | FLPiePlotable |