Fully customizable line chart for SwiftUI 🀩

Overview

πŸ§€ CheesyChart

Create amazing Crypto and Stock charts πŸ“ˆ πŸ“‰

Looking for an easy to use and fully customizable charting solution written in SwiftUI? Then check out CheesyChart – it’s a Swift Package that makes it simple to create beautiful charts in your own projects. With just a few lines of code, you can create prefect line charts. And if you need to display the current value of the chart, there’s an interactive label for that too. 😩

So whether you want to create a simple chart or a more complex one, CheesyChart has you covered!

πŸ›  Installation

CheesyChart requires iOS 14 and Xcode 12.

1️⃣ In Xcode go to File ➀ Add Packages...

2️⃣ In the top right corner, paste https://github.com/adri567/CheesyChart.git πŸ§€ and press Enter.

3️⃣ Choose CheesyChart from the list ➀ Add Package

This was easy, or? Now you can use CheesyChart in your project! πŸ“ˆ πŸ“‰

πŸ“Š Here are some examples

πŸͺ› Usage

Copy this code ⬇️

import CheesyChart

Example 1

/// You need a @State var if you want to use the tapPoint to show the current price of the stock or coin in a extra TextView
@State var value: Int? = 0

let setup = SetupChart(
           name: (stock or coin name),
           data:  (price data),
           image: UIImage(named: "Image"),
           chartHeight: 250,
           animateChart: true,
           chartBackground: .cb5,
           chartBackgroundColor: Color(UIColor.systemGroupedBackground).opacity(0.3),
           showYAxiesStats: true,
           yAxiesStatsColor: .black,
           showShadow1: true,
           showShadow2: true,
           chartPriceLabelColor: Color(UIColor.systemGroupedBackground).opacity(0.3),
           chartPriceLabelFontColor: .black
       )

CheesyChart(setup: setup, tapPoint: $value)

Example 2

let setup = SetupChart(
               data: data,
               animateChart: true,
               startAnimationAfterAppear: 0.2,
               chartBackground: .cb2,
               chartBackgroundColor: Color.theme.background,
               showYAxiesStats: true,
               yAxiesStatsColor: Color.theme.accent,
               showShadow1: true,
               showShadow2: true,
               showShadow3: true,
               showShadow4: true,
               chartPriceLabelColor: Color.theme.background,
               chartPriceLabelFontColor: Color.theme.accent,
               chartPriceLabelShadow: Color.theme.accent
           )

CheesyChart(setup: setup)

All setup possibilities with it's standard values πŸ”₯

name: String = "" // Name of the coin or stock

data: [Double] = [] // Price data

image: UIImage? = UIImage(systemName: "bitcoinsign.circle.fill") // Standart image if image is shown
       
showChartHeader: Bool = false // Default chart header

chartHeaderFontColor: Color = .black // Font color of the chart

chartHeaderColor: Color = .clear // Whole color of the chart

showHeaderImage: Bool = false // Show header image
       
chartWidth: Double = UIScreen.main.bounds.width // Width of the chart

chartHeight: Double = 200 // Height of the chart
       
animateChart: Bool = false // Line animation (from 0 to 1)

startAnimationAfterAppeariance: CGFloat = 0.1 // Animation after the appearance of the chart

chartAnimationDuration: CGFloat = 1.0 // Duration of the animation
       
chartBackground: Background = .none // Chart backgrounds (choose between .none, .cb1, .cb2, .cb3, .cb4, .cb5)

chartBackgroundColor: Color = .white // Whole background color of the chart

chartBackgroundDividerColor: Color = Color(UIColor.lightGray).opacity(0.2) // X axies divider color

showYAxiesStats: Bool = false // Price stats on the left across the y axies

yAxiesStatsColor: Color = .black // Color of the stats

yAxiesStatsAlignment: YAxiesAlignment = .leading // Position of the y axies stats
       
chartLineColorOnHigh: Color = .green // Chart color if the price goes up

chartLineColorOnLow: Color = .red // Chart color if the price goes down

chartLineWidth: CGFloat = 2 // Width of the chart line
       
showShadow1: Bool = false // Shadow 1 of the line

showShadow2: Bool = false // Shadow 2 of the line

showShadow3: Bool = false // Shadow 3 of the line

showShadow4: Bool = false // Shadow 4 of the line
       
chartPriceLabelColor: Color = .clear // Color of the drag price label

chartPriceLabelFontColor: Color = .black // Font color of the drag price label

chartPriceIndicatorColor: Color = Color(UIColor.lightGray) // Color of the price y axies indicator

chartPriceLabelYAxies: CGFloat = 40.0 // Position of the price label on the y axies

chartPriceLabelCornerRadius: CGFloat = 5 // Corner radius of the price label

chartPriceLabelShadow: Color = .clear // Shadow of the price label
Thanks Nick for letting me use your crypto app as a showcase for CheesyChart! πŸ’―
You might also like...
SwiftUI Bar Chart
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

A SwiftUI Framework for Drawing Chart
A SwiftUI Framework for Drawing Chart

PrettyAxis A SwiftUI Framework for drawing charts. Fearture Support Drawing Bar Chart RadarChart Line Chart and Scatter Charts Pie Chart and Donut Cha

Demo-implementation of 5 different Chart Libraries in SwiftUI

Comparison of Chart Libraries for SwiftUI Read the entire blog post including images on jannikarndt.de! I want to add charts to my SwiftUI iOS App, Ze

A SwiftUI Contribution Chart (GitHub-like) implementation package
A SwiftUI Contribution Chart (GitHub-like) implementation package

ContributionChart A contribution chart (aka. heatmap, GitHub-like) library for iOS, macOS, and watchOS. 100% written in SwiftUI. It Supports Custom Bl

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

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

Releases(1.1.2)
Owner
adri567
I like to program in Swift and Python πŸ™ƒ Check out my apps πŸ“² Vimoapp and Sneakz.
adri567
Fully customizable line chart for SwiftUI 🀩

?? CheesyChart Create amazing Crypto and Stock charts ?? ?? Looking for an easy to use and fully customizable charting solution written in SwiftUI? Th

adri567 13 Dec 14, 2022
JTChartView is the new lightweight and fully customizable solution to draw a chart

JTChartView JTChartView is the new lightweight and fully customizable solution to draw a curve and fill the space underneath it with a gradient. The r

Jakub TruhlΓ‘Ε™ 124 Sep 7, 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 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
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

Arthur 856 Nov 24, 2022
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

Andrzej Naglik 421 Dec 11, 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
Demonstrate a way to build your own line chart without using any third-party library

LineChart This code demonstrate a way to build your own line chart without using any third-party library. It contains a simple yet effective algorithm

Van Hung Nguyen 0 Oct 17, 2021
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
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

iOSCS 40 Nov 29, 2022