MSBBarChart is an easy to use bar chart library for iOS

Related tags

Charts MSBBarChart
Overview

MSBBarChart

Platform Version Carthage compatible License Swift Package Manager compatible

MSBBarChart is an easy to use bar chart library for iOS.

Usage

スクリーンショット 2020-02-04 16 38 16

if you want to hide label above bar

barChart.setOptions([.isHiddenLabelAboveBar(true)])

if you want to hide labels and lines

barChart.setOptions([.isHiddenExceptBars(true)])

if you want to add some gradient to your bars

barChart.setOptions([.isGradientBar(true)])

// Instead of assignmentOfColor 
barChart.assignmentOfGradient = [0.0..<0.25: [#colorLiteral(red: 0.1294117719, green: 0.2156862766, blue: 0.06666667014, alpha: 1),#colorLiteral(red: 0.1960784346, green: 0.3411764801, blue: 0.1019607857, alpha: 1)], 0.25..<0.50: [#colorLiteral(red: 0.1960784346, green: 0.3411764801, blue: 0.1019607857, alpha: 1),#colorLiteral(red: 0.2745098174, green: 0.4862745106, blue: 0.1411764771, alpha: 1)], 0.50..<0.75:[#colorLiteral(red: 0.2745098174, green: 0.4862745106, blue: 0.1411764771, alpha: 1),#colorLiteral(red: 0.3411764801, green: 0.6235294342, blue: 0.1686274558, alpha: 1)], 0.75..<1.0: [#colorLiteral(red: 0.3411764801, green: 0.6235294342, blue: 0.1686274558, alpha: 1),#colorLiteral(red: 0.4666666687, green: 0.7647058964, blue: 0.2666666806, alpha: 1)]]

Installation

CocoaPods

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

pod 'MSBBarChart'

Carthage

Carthage is a decentralized dependency manager for Cocoa application.

$ brew update
$ brew install carthage

To integrate MSBBarChart into your Xcode project using Carthage, specify it in your Cartfile:

github "misyobun/MSBBarChart"

Then, run the following command to build the MetaRod framework:

$ carthage update --platform iOS

You will then have to drag MSBBarChart.framework yourself into your project from the Carthage/Build folder.

Comments
  • Scrolling clips content

    Scrolling clips content

    With a large dataset, the chart enables scrolling but then clips the last bar when it settles. Also the y axis interval lines don't cover the entire width of the view when scrolling is enabled.

    image

    ^ pulling the view reveals the last bar 31 ^

    image

    ^ letting go settles the view and clips bar 30 and 31 ^

    image

    ^ bar 1 and 13 are visible but the axis and interval lines don't extend that far ^

    bug 
    opened by philmodin 6
  • crash when chart data is empty

    crash when chart data is empty

    When there is no data passed to the chart it attempts to draw the view but CALayer crashes due to NaN in the yPosition

    In version 1.1.1 this didn't crash. In version 1.1.2 it crashes.

    Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [30.7857 nan]. Layer: <CALayer:0x281b12640; position = CGPoint (30.7857 246); bounds = CGRect (0 0; 45.5714 0); allowsGroupOpacity = YES; anchorPoint = CGPoint (0.5 1); backgroundColor = <CGColor 0x283fba520> [<CGColorSpace 0x283fa4420> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; sRGB IEC61966-2.1; extended range)] ( 0.152941 0.658824 0.909804 1 ); animations = [bounds=<CABasicAnimation: 0x281b13d80>]>'

    libc++abi.dylib: terminating with uncaught exception of type NSException

    bug 
    opened by philmodin 5
  • Incorrect Bar Height or Incorrect Interval Label

    Incorrect Bar Height or Incorrect Interval Label

    Sometimes the bars are drawn at incorrect heights in relation to the interval lines when I set yAxisNumberOfInterval option.

    If I don't set that option, then the charts draw correctly.

    This one, I set .yAxisNumberOfInterval(4) image

    This one, I set .yAxisNumberOfInterval(4) image

    bug 
    opened by philmodin 3
  • Make it be scrollable by setting the minimum width of the bar

    Make it be scrollable by setting the minimum width of the bar

    Overview

    Since the bar width was determined based on the screen width, the bar width was not a realistic value when there were many items on the X axis. I'll fix this issue. This support enables horizontal scrolling.

    opened by misyobun 1
  • Touchable Bars

    Touchable Bars

    I would like to touch a bar and display its value in another part of the UI.

    Can you detect a bar touch and pass its data value via touch event as well as dragging across bars and updating the value as you drag?

    request 
    opened by philmodin 0
  • More Customization

    More Customization

    I would like to be able to fit more bars without scrolling. Example: 31 days in a month, 52 weeks in a year. Can you add customization for: min bar width, corner radius. Or reduce widths automatically if scrolling is disabled.

    Also I would like to remove the label above each bar.

    request 
    opened by philmodin 0
Owner
misyobun
misyobun
SwiftUI library to easily render diagrams given a tree of objects. Similar to ring chart, sunburst chart, multilevel pie chart.

Swift Sunburst Diagram Sunburst diagram is a library written with SwiftUI to easily render diagrams given a tree of objects. Similar to ring chart, su

Ludovic Landry 494 Dec 19, 2022
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
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
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
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
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
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

Hadi Dbouk 84 Apr 25, 2022
Repository with example app for using Bar chart

Gráfico de Barras (Exemplo) Repositório com app exemplo para o uso do gráfico de Barras. O gráfico de barras é um gráfico com barras retangulares e co

Felipe Leite 0 Nov 5, 2021
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
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
Core Charts | Basic Scrollable Chart Library for iOS

Core Charts | Basic Chart Library for iOS HCoreBarChart VCoreBarChart Requirements Installation Usage Appearance Customization Getting Started You nee

Çağrı ÇOLAK 71 Nov 17, 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
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
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

Kevin 9.8k Jan 6, 2023
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

junyixie 868 Nov 16, 2022
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

XY Feng 1.7k Sep 6, 2022
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

Scott Zhu 646 Dec 27, 2022
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

Johnny Wu 416 Dec 31, 2022
candlestick chart for ios

###Licenses (The MIT License) Copyright ©2012 zhiyu zheng all rights reserved. Permission is hereby granted, free of charge, to any person obtaining a

ZhiYu 962 Oct 17, 2022