Swiftpack.co - CoderWQYao/WQCharts-iOS as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
CoderWQYao/WQCharts-iOS
highly customizable and easy to use chart library for iOS
.package(url: "https://github.com/CoderWQYao/WQCharts-iOS.git", from: "1.2.1")

WQCharts

Version License Platform

  • WQCharts highly customizable and easy to use chart library for iOS

Installation

There are four ways to use WQCharts in your project:

Installation with CocoaPods

pod 'WQCharts'

Installation with Swift Package Manager (Xcode 11+)

Swift Package Manager (SwiftPM) is a tool for managing the distribution of Swift code as well as C-family dependency. From Xcode 11, SwiftPM got natively integrated with Xcode.

WQCharts support SwiftPM from version 5.1.0. To use SwiftPM, you should use Xcode 11 to open your project. Click File -> Swift Packages -> Add Package Dependency, enter WQCharts repo's URL. Or you can login Xcode with your GitHub account and just type WQCharts to search.

Import

  • Objective-C
#import <WQCharts/WQCharts-Swift.h>
  • Swift
import WQCharts

How to use WQCharts

Using ChartView

  • Objective-C
    // Set chart parameters
    chartView.chart.padding = padding;
    chartView.chart.items = items;
    // ...
    [chartView redraw];
  • Swift
    // Set Chart parameters
    chartView.chart.padding = padding;
    chartView.chart.items = items;
    // ...
    chartView.redraw()

Using Chart

  • Objective-C
    // Set Chart parameters
    chart.padding = padding;
    chart.items = items;
    // Draw Chart in CGContext
    [chart drawInRect:rect context:context];
  • Swift
    // Set Chart parameters
    chart.padding = padding;
    chart.items = items;
    // Draw Chart in CGContext
    chart.draw(inRect: rect, context: context)

Using Animation

  • Objective-C
    WQAnimationPlayer* animationPlayer = [[WQAnimationPlayer alloc] initWithDisplayView:self.chartView];
    // The ChartView、Chart conforms to Transformable protocol
    WQAnimation* animation = [[WQAnimation alloc] initWithTransformable:self.chartView duration:0.5];
    [animationPlayer startAnimation:animation];
    self.animationPlayer = animationPlayer;
  • Swift
    let animationPlayer = AnimationPlayer(displayView: self.chartView)
    // The ChartView、Chart conforms to Transformable protocol
    let animation = Animation(self.chartView, 0.5)
    animationPlayer.startAnimation(animation)
    self.animationPlayer = animationPlayer

Architecture

Structure Diagram

Structure Diagram

Chart Class Diagram

Chart Class Diagram

View Class Diagram

View Class Diagram

Examples

WQCharts_Polygon WQCharts_Pie WQCharts_Pie WQCharts_Axis WQCharts_Bar WQCharts_Biz

GitHub

link
Stars: 129
Last commit: 1 year ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics