FlowerChart - custom chart written in Swift

Related tags

Charts FlowerChart
Overview

FlowerChart - custom chart written in Swift

Fully vector flower-shaped chart written in Swift

Swift Version License Platform

Flower-shaped chart written in Swift, this repo is a sample project you can build directly on your iPhone. The charts generated are fully vector and scale without any rasterization and annying pixels. Part of the Awesome iOS curated list.

The chart itself looks as follows:

alt tag

Features

  • Fully vector petals, well adjusted to any screen size
  • Supports any number of petals
  • All petals can be color-coded

Requirements

  • iOS 8.0+
  • Xcode 9

Installation & usage

Manually

  1. Download and drop FlowerChart.swift in your project.
  2. Congratulations, you are all set!

Usage example

You can set arbitrary number of "petals" for the flower while creating an instance of the FlowerChart class, draw the flower itself with drawFlower method (providing an array of UIColors for petals to look the way you like) and set sizes to them using the setPetalSizes method. Size for each petal has to be a Double 0.0 ..< 10.0 (no failsafe check in place yet, to be added in future releases). In the sample project there is a Refresh button that generates random sizes for all the petals to show how the chart might look like.

To use flower charts in your own project - just add the FlowerChart.swift file to it. You'd need a pre-set UIView which will serve as a canvas for the chart to appear on (just create a basic outlet for it), it's auto-fitted inside the view so no restrictions on its layout.

In the ViewController you need the following properties:

var flowerChart: FlowerChart!
var sizesArray = [Double]()
var colorsArray = [UIColor]()
let totalPetals = 9 // Set any number of petals you need

Ensure sizesArray and colorsArray contain necessary amount of elements to draw the number of petals you need. Create an instance of FlowerChart class on viewDidAppear and set it up in just 4 lines of code:

let flowerChart = FlowerChart(petalCanvas: petalCanvas, totalPetals: totalPetals)
self.flowerChart = flowerChart
flowerChart.drawFlower(colorsArray)
flowerChart.setPetalSizes(sizesArray)

Release History

  • 0.1.0
    • The first release, current version

Contribute

We would love for you to contribute to Flowerchart, check the LICENSE file for more info.

Meta

Alexander Telegin – @drinkius[email protected]

Distributed under the MIT license. See LICENSE for more information.

https://github.com/drinkius/flowerchart

Good luck and feel free to report any issues, I'll fix them shortly!

You might also like...
A simple and beautiful chart lib used in Piner and CoinsMan for iOS
A simple and beautiful chart lib used in Piner and CoinsMan for iOS

PNChart You can also find swift version at here https://github.com/kevinzhow/PNChart-Swift A simple and beautiful chart lib with animation used in Pin

iOS Chart. Support animation, click, scroll, area highlight.
iOS Chart. Support animation, click, scroll, area highlight.

XJYChart XJYChart - A High-performance, Elegant, Easy-to-integrate Charting Framework. The Best iOS Objc Charts. chart more beautiful support chart sc

A simple and animated Pie Chart for your iOS app.

XYPieChart XYPieChart is an simple and easy-to-use pie chart for iOS app. It started from a Potion Project which needs an animated pie graph without i

iOS/iPhone/iPad Chart, Graph. Event handling and animation supported.
iOS/iPhone/iPad Chart, Graph. Event handling and animation supported.

#EChart A highly extendable, easy to use chart with event handling, animation supported. ##Test How To Use Download and run the EChartDemo project is

FSLineChart  A line chart library for iOS.
FSLineChart A line chart library for iOS.

FSLineChart A line chart library for iOS. Screenshots Installing FSLineChart Add the contents of the FSLineChart project to your directory or simply a

ANDLineChartView is easy to use view-based class for displaying animated line chart.
ANDLineChartView is easy to use view-based class for displaying animated line chart.

ANDLineChartView for iOS ANDLineChartView is easy to use view-based class for displaying animated line chart. Usage API is simple. Just implement foll

an iOS open source Radar Chart implementation
an iOS open source Radar Chart implementation

JYRadarChart an open source iOS Radar Chart implementation ##Screenshots Requirements Xcode 5 or higher iOS 5.0 or higher ARC CoreGraphics.framework D

This is pie chart that is very easy to use and customizable design.
This is pie chart that is very easy to use and customizable design.

CSPieChart Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installation CSPieCh

Draw a chart with progress bar style
Draw a chart with progress bar style

ChartProgressBar-iOS Draw a chart with progress bar style - the android version here Installation iOS version (9.0,*) Swift 3.2 Using cocoapods : pod

Comments
  • Better README.md

    Better README.md

    Hey, I loved your library and for it to be perfect we just needed to work a little bit more on the README.md. You can use this README project as an example

    opened by lfarah 2
  • Petal Labels...

    Petal Labels...

    It'd be great if we could have labels displayed either on the petals themselves or just outside the corresponding petals. Is this a realistic possibility? Your flowerchart is vastly underrated.

    opened by 36bydesign 2
  • Update to Xcode 9.4.1 / Swift 4.2

    Update to Xcode 9.4.1 / Swift 4.2

    This pull request upgrades FlowerChart to Xcode 9.4.1 / Swift 4.2 .

    • Fix 9 yellow compiler warnings and upgrade to Xcode 9.4.1 / Swift 4.2 .
    • Add AppIcon
    • Add LaunchScreen image
    opened by kellyroach 0
Owner
Alexander Telegin
GC DAO core dev
Alexander Telegin
Simple and intuitive iOS chart library. Contribution graph, clock chart, and bar chart.

TEAChart Simple and intuitive iOS chart library, for Pomotodo app. Contribution graph, clock chart, and bar chart. Supports Storyboard and is fully ac

柳东原 · Dongyuan Liu 1.2k Nov 29, 2022
Flower-like chart written in Swift

FlowerChart - custom chart written in Swift Fully vector flower-shaped chart written in Swift Flower-shaped chart written in Swift, this repo is a sam

Alexander Telegin 15 Jun 9, 2021
Easy to use Spider (Radar) Chart library for iOS written in Swift.

DDSpiderChart Easy to use Spider (Radar) Chart library for iOS written in Swift. Requirements iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+ Xcode

Deniz Adalar 82 Nov 14, 2022
Line Chart library for iOS written in Swift

Swift LineChart Usage var lineChart = LineChart() lineChart.addLine([3, 4, 9, 11, 13, 15]) Features Super simple Highly customizable Auto scaling Touc

Mirco Zeiss 601 Nov 15, 2022
An interactive line chart written in SwiftUI with many customizations.

LineChartView LineChartView is a Swift Package written in SwiftUI to add a line chart to your app. It has many available customizations and is interac

Jonathan Gander 59 Dec 10, 2022
A simple and beautiful chart lib used in Piner and CoinsMan for iOS(https://github.com/kevinzhow/PNChart) Swift Implementation

PNChart-Swift PNChart(https://github.com/kevinzhow/PNChart) Swift Implementation Installation This isn't on CocoaPods yet, so to install, add this to

Kevin 1.4k Nov 7, 2022
TKRadarChart - A customizable radar chart in Swift

TKRadarChart A customizable radar chart in Swift Requirements iOS 8.0+ Xcode 9.0 Swift 4.0 Installation CocoaPods You can use CocoaPods to install TKR

TBXark 203 Dec 28, 2022
Using Swift Charts and Voiceover Chart Descriptor to compose music. 🤯

Chart de lune ?? Using Swift Charts and Voiceover Chart Descriptor to compose music. ?? Image source: https://hadikarimi.com/portfolio/claude-debussy-

An Trinh 31 Nov 21, 2022
SwiftUI Bar Chart

SwiftUI BarChart Lightweight and easy to use SwiftUI chart library for all Apple platforms Features Scaling on both axes Fully customizable axes (labe

Roman Baitaliuk 158 Jan 6, 2023
A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.

⚡ A powerful & easy to use chart library for Android ⚡ Charts is the iOS version of this library Table of Contents Quick Start Gradle Maven Documentat

Philipp Jahoda 36k Jan 5, 2023