Home

Awesome

FLCharts

FLCharts

Version Platforms License Carthage compatible Swift Xcode 11.0+ iOS 11.0+ SPM

FLCharts is an easy-to-use library to build highly customizable bar, line and pie charts. It allows you to create your own chart bar UIView and use it to display data in the chart. <br> Additionally FLCharts allows you to provide a custom HighlightedView to show the highlighted bar contents on top of the chart. <br> Embed effortlessly your chart in a FLCard alogside with a title, an average vlue view and additional behaviours.

Table of Contents

Requirements <a name="requirements"></a>

Installation <a name="installation"></a>

FLCharts is available through SPM, CocoaPods and Carthage

Swift Package Manager <a name="SPM"></a>

In XCode go to File -> Add Packages...

Search for https://github.com/francescoleoni98/FLCharts and click Add Package.

Select to which target you want to add it and select Add Package.

CocoaPods <a name="cocoapods"></a>

FLCharts is available through CocoaPods. To install it, add the following line to your Podfile:

pod 'FLCharts'

Then run pod install

Carthage <a name="carthage"></a>

To install it with Carthage, in your Cartfile add:

github "francescoleoni98/FLCharts"

Then run carthage update

In XCode > Build phases click the plus button on top left > New Run Script Phases. <br> Then in Run Script > Shell script window > add /usr/local/bin/carthage copy-frameworks. <br> Run Script > Input file window > add $(SRCROOT)/Carthage/Build/iOS/FLCharts.framework.

Then, go to $project_dir/Carthage/Build/iOS and drag the folder FLCharts.framework into your Xcode Project > Your Target > Frameworks, Libraries and Embedded Content.

Example

Here you can find a guide about how to setup a bar chart using FLCharts:

FLCharts: Create Bar Chart easily

Features <a name="features"></a>

Configurations <a name="configurations"></a>

FLChart is highly customizable. You can choose which property to modify through the .config property.

let axisLabelConfig = FLAxisLabelConfig(color: .black,
                                        font: .preferredFont(forTextStyle: .body))
                         
chart.config = ChartConfig(axesLabels: axisLabelConfig)

Prebuilt bar cells <a name="barcells"></a>

Use this bars when you configure your chart.

Eg. FLChart(data: ..., type: .bar(bar: FLMultipleValuesChartBar.self))

Docs <a name="docs"></a>

You can build FLCharts documentation directly in XCode. </br> In XCode go to Product -> Build Documentation, once XCode has finished building, the documentation will appear.

Chart types <a name="charttypes"></a>

Plain Bar ChartMulti Value Bar ChartHorizontal Multi Value Bar Chart
Bar class: FLPlainChartBarBar class: FLMultipleValuesChartBarBar class: FLHorizontalMultipleValuesChartBar
Data type: SinglePlotableData type: MultiPlotableData type: MultiPlotable
<img width=0 height=40 />
Line ChartMulti Value Line ChartScatter Chart
Data type: SinglePlotableData type: MultiPlotableData type: ScatterPlotable
<img width=0 height=40 />
Radar ChartPie Chart
Data type: FLDataSetData type: FLPiePlotable

Examples <a name="examples"></a>

Highlighted BarAverage viewBar chart embedded in FLCard
Highlight View: BarHighlightedViewshowAverage = true
highlighted baraverage viewbar chart embedded in FLCard
<img width=0 height=40 />
Dark ModeLine Chart X and Y SegmentsPie Chart
X Segments: Key(key: String, xColors: [UIColor])
Y Segments: Key(key: String, yThresholds: [CGFloat : UIColor], data: [PlotableData])
dark modex y segmentspie chart

Animations <a name="animations"></a>

alt tag

alt tag

alt tag

Apps that uses FLCharts <a name="apps"></a>

Author

Francesco Leoni | @franceleonidev | leoni.francesco98@gmail.it

License <a name="license"></a>

FLCharts is available under the MIT license. See the LICENSE file for more info.