Giter VIP home page Giter VIP logo

chartcircle's Introduction

ChartCircle

属性

percentages
设置百分比展示

colors
设置颜色数组,色块的颜色与文字颜色,业务颜色为默认黑色,如需更改修改源码

titles
设置展示的业务文字


调用


    ChartCircleView *view = [[ChartCircleView alloc] init];
    view.backgroundColor = [UIColor whiteColor];
    view.frame = CGRectMake(0,  (self.view.bounds.size.height - 400 ) / 2, self.view.bounds.size.width, 400);
    view.titles  = @[@"业务1",
                     @"业务2",
                     @"业务3",
                     @"业务4",
                     @"业务5",
                     @"业务6",
                     @"业务7",
                     @"业务8",
                     @"业务9",
                     @"业务10",
                     @"业务11",
    ];
    view.colors = @[[UIColor colorWithRed:0.584314 green:0.85098 blue:0.45098 alpha:1],
                    [UIColor colorWithRed:0.317647 green:0.415686 blue:0.996078 alpha:1],
                    [UIColor colorWithRed:0.882353 green:0.423529 blue:0.423529 alpha:1],
                    [UIColor colorWithRed:0.819608 green:0.882353 blue:0.423529 alpha:1],
                    [UIColor colorWithRed:0.121569 green:0.223529 blue:0.792157 alpha:1],
                    [UIColor colorWithRed:0.956863 green:0.678431 blue:0.278431 alpha:1],
                    [UIColor colorWithRed:0.380392 green:0.780392 blue:0.596078 alpha:1],
                    [UIColor colorWithRed:0.172549 green:0.694118 blue:0.917647 alpha:1],
                    [UIColor colorWithRed:0.317647 green:0.317647 blue:0.960784 alpha:1],
                    [UIColor colorWithRed:0.811765 green:0.423529 blue:0.882353 alpha:1],
                    [UIColor colorWithRed:0.592157 green:0.45098 blue:0.85098 alpha:1]];
    
    view.percentages = @[@(0.0212),
                         @(0.0302),
                         @(0.0601),
                         @(0.0902),
                         @(0.0823),
                         @(0.311),
                         @(0.311),
                         @(0.0609),
                         @(0.0012),
                         @(0.6543000000000001),
                         @(0.028)];
    
    
    [self.view addSubview:view];
    
    [view draw];
    [view animateChart];

[view draw];
[view animateChart];

注意

percentages colors titles 个数需保持一致

展示效果

Simulator Screen Shot - iPhone 14 Pro - 2023-07-11 at 17 15 20

chartcircle's People

Contributors

applebest avatar

Watchers

 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.