GithubHelp home page GithubHelp logo

aawayne / flradarchart Goto Github PK

View Code? Open in Web Editor NEW

This project forked from romanticencounter/flradarchart

0.0 1.0 0.0 136 KB

A simple radar chart based on CAShapeLayer.

License: MIT License

Objective-C 99.77% Ruby 0.23%

flradarchart's Introduction

FLRadarChart

雷达图

使用UIBezierPath + CAShaperLayer绘制

学习如何一步步的绘制Radar Chart

雷达图最终效果

如何使用

创建

FLRadarChartView *radarChartView = [[FLRadarChartView alloc] initWithFrame:CGRectMake(0, 80, CGRectGetWidth(self.view.frame), CGRectGetWidth(self.view.frame))];
radarChartView.backgroundColor = [UIColor groupTableViewBackgroundColor];
radarChartView.minValue = 0.0;
radarChartView.maxValue = 100.0;
radarChartView.allowOverflow = YES;
[self.view addSubview:radarChartView];

传入数据源

FLRadarChartModel *model_1 = [[FLRadarChartModel alloc]init];
model_1.name = @"能力1";
model_1.valueArray = @[@10, @20, @30, @40, @50, @60];
model_1.strokeColor = [UIColor redColor];
model_1.fillColor = [[UIColor redColor] colorWithAlphaComponent:0.3];
    
FLRadarChartModel *model_2 = [[FLRadarChartModel alloc]init];
model_2.name = @"能力2";
model_2.valueArray =  @[@100, @90, @80, @70, @60];
model_2.strokeColor = [UIColor greenColor];
model_2.fillColor = [[UIColor greenColor] colorWithAlphaComponent:0.3];

//设置分类数据标题
radarChartView.classifyDataArray = @[@"Objective-C",@"Swift",@"Python",@"Java",@"C",@"C++"];

//设置数据源
radarChartView.dataArray = @[model_1, model_2];

//绘制
[radarChartView fl_redrawRadarChart];

flradarchart's People

Contributors

romanticencounter avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.