an iOS open source Radar Chart implementation

Overview

JYRadarChart

an open source iOS Radar Chart implementation

##Screenshots

iPhone Screenshot1 iPhone Screenshot2 iPhone Screenshot3

Requirements

  • Xcode 5 or higher
  • iOS 5.0 or higher
  • ARC
  • CoreGraphics.framework

Demo

Build and run the JYRadarChartDemo project in Xcode

##Installation

###CocoaPods

  1. Create a Podfile in your project folder if you don't have one
  2. Add a pod entry for JYRadarChart to your Podfile pod 'JYRadarChart'
  3. Install the pod(s) by running pod install
  4. Include JYRadarChart wherever you need it with #import "JYRadarChart.h"

###Manual Install

All you need to do is drop JYRadarChart files into your project, and add #import "JYRadarChart.h" to the top of classes that will use it.

##Example Usage

###minimum JYRadarChart *p = [[JYRadarChart alloc] initWithFrame:CGRectMake(30, 20, 200, 200)]; p.dataSeries = @[@[@(51),@(44),@(94),@(84),@(90)]]; p.attributes = @[@"attack",@"defense",@"speed",@"HP",@"MP"]; [self.view addSubview:p];

###fully customized

JYRadarChart *p = [[JYRadarChart alloc] initWithFrame:CGRectMake(20, 20, 200, 200)];

NSArray *a1 = @[@(81), @(97), @(87), @(60), @(65), @(77)];
NSArray *a2 = @[@(91), @(87), @(33), @(77), @(78), @(96)];

//set the data series
p.dataSeries = @[a1, a2];

//how many "circles" in the chart 
p.steps = 4;

//for the the entire background
p.backgroundColor = [UIColor whiteColor];

//you can specify the background fill color
//(just for the chart, not the entire background of the view)
p.backgroundFillColor = [UIColor grayColor];

//you can set radius, min and max value by yourself, but if you
//leave r (will fill the rect), minValue (will be 0), maxValue (default is 100) alone, 
//that is okay. the points with too big value will be out of the chart and thus invisible
p.r = 60;
p.minValue = 20;
p.maxValue = 120;

//you can choose whether fill area or not (just draw lines) 
p.fillArea = YES;

//you can specify the opacity, default is 1.0 (opaque)
p.colorOpacity = 0.7;
p.attributes = @[@"Attack", @"Defense", @"Speed", @"HP", @"MP", @"IQ"];

//if you do not need a legend, you can safely get rid of setTitles:
p.showLegend = YES;
[p setTitles:@[@"archer", @"footman"]];

//there is a color generator in the code, it will generate colors for you
//so if you do not want to specify the colors yourself, just delete the line below
[p setColors:@[[UIColor grayColor],[UIColor blackColor]]];
[self.view addSubview:p];

##Customization

here are all the properties you can change, you can find them in JYRadarChart.h

@property (nonatomic, assign) CGFloat r;
@property (nonatomic, assign) CGFloat maxValue;
@property (nonatomic, assign) CGFloat minValue;
@property (nonatomic, assign) BOOL drawPoints;
@property (nonatomic, assign) BOOL fillArea;
@property (nonatomic, assign) BOOL showLegend;
@property (nonatomic, assign) BOOL showStepText;
@property (nonatomic, assign) CGFloat colorOpacity;
@property (nonatomic, strong) UIColor *backgroundLineColorRadial;
@property (nonatomic, strong) UIColor *backgroundFillColor;
@property (nonatomic, strong) NSArray *dataSeries;
@property (nonatomic, strong) NSArray *attributes;
@property (nonatomic, assign) NSUInteger steps;
@property (nonatomic, assign) CGPoint centerPoint;

- (void)setTitles:(NSArray *)titles;
- (void)setColors:(NSArray *)colors;

##Contact

johnny.wjy07#gmail.com

Feel free to send me pull requests!

Enjoy it~

##License

JYRadarChart is available under the MIT license.

The MIT License (MIT)

Copyright (c) 2013 Johnny Wu

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You might also like...
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

Line Chart library for iOS written in Swift
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

Core Charts | Basic Scrollable Chart Library for iOS
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

candlestick chart for ios
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

A simple pie chart for iOS.
A simple pie chart for iOS.

EGPieChart Installation EGPieChart is available through CocoaPods. To install it, simply add the following line to your Podfile: pod 'EGPieChart' manu

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

MSBBarChart MSBBarChart is an easy to use bar chart library for iOS. Usage if you want to hide label above bar barChart.setOptions([.isHiddenLabelAbov

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

Comments
  • Can not use in storyboard or nib file

    Can not use in storyboard or nib file

    I want to use JYRadarChart view as a custom view in storyboard's UIView,but I found that the .m file doesn't implement initWithCoder method,only initWithFrame method is implemented.Anyway,I think it is better to implement initWithCoder method. The method content is the same as the initWithFrame method.

    opened by tounaobun 1
  • Fix 64bit compilation

    Fix 64bit compilation

    This line was breaking when compiling under Arm64 architecture (for release) with the following error: Multiple methods named 'count' found with mismatched result, parameter type or attributes (ARC semantic issue)

    opened by mberube09 0
  • Kellyroach/upgrade to xcode941

    Kellyroach/upgrade to xcode941

    This pull request upgrades JYRadarChart to Xcode 9.4.1 / Swift 4.2 . Xcode 9.4.1 reports "Compiling IB documents for earlier than iOS 7 is no longer supported" on master branch if we try to compile target in JYRadarChartDemo.xcodeproj . The pull request fixes this problem and other compiler warning and Analyze issues.

    • Upgrade to Xcode 9.4.1 / Swift 4.2 . Both demo apps run OK.
    • Main.storyboard's, JYRadarChart radar1 + radar2 subviews, IBOutlet's to ViewController.swift's.
    • Add AppIcon's and LaunchImage's.
    • Add timer randomness to radar1's r and centerPoint

    We agree to the MIT license.

    opened by kellyroach 0
  • Cannot Set BackgroundLineColor

    Cannot Set BackgroundLineColor

    Hi there,

    The source code suggests that "backgroundLineColor" is the one to change if I want to modify the color of radial indicator, rather than "backgroundLineColorRadial." But the point is that no matter how I set it, especially when my intention is to set it "clearColor", there will be dark-grey radial indicator lines. If I were to have 1000 data, then the background would be completely covered by these dark-grey radial lines. Please update this.

    opened by gcmike 0
Releases(0.3.3)
Owner
Johnny Wu
Johnny Wu
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
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
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
Repositório com o app exemplo para o uso do gráfico radar.

RadarExample Repositório com o app exemplo para o uso do gráfico radar. É um método gráfico de apresentar dados multivariáveis, na forma de um gráfico

null 0 Nov 5, 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
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

Jannik Arndt 73 Oct 12, 2022
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

null 41 Dec 27, 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