ios绘制半圆图表 HUChart

码农软件 · 软件分类 · 图表(Charting) · 2019-07-07 19:28:02

软件介绍

HUChart是一个简单的(但是是第一个)ios的绘制半圆圈图(半饼图)表的工具。绘制半圆图表是为了在某些情况下,用一个小空间去完成一个完整的圆图。

相关特性:

  • 半圆图表绘制工具就像一个 UIView 的组件. 可以不费一点力气绘制一个定制的半圆图表。
  • 支持 iOS 6.1以上的版本
  • 支持ARC

https://dl.dropboxusercontent.com/s/u5siul88u80lev8/semiCircleChart_example.png

SemiCircle Chart Iphone

用法如下:

    // Step 1: Create HUSemiCircleChart object with its desire frame
    CGRect frame = CGRectMake(25, 30, 250, 300);
    HUSemiCircleChart *semiCircleChart = [[HUSemiCircleChart alloc]
                                                            initWithFrame:frame];

    // Step 2: Setup data
    NSMutableArray *data = [NSMutableArray arrayWithObjects:
                                    [[HUChartEntry alloc]initWithName:@"Chrome" value:@54.1],
                                    [[HUChartEntry alloc]initWithName:@"Firefox" value:@27.2],
                                    [[HUChartEntry alloc]initWithName:@"IE" value:@11.7],
                                    [[HUChartEntry alloc]initWithName:@"Safari" value:@3.8],
                                    [[HUChartEntry alloc]initWithName:@"Others" value:@3.2],
                                    nil];
    [semiCircleChart setData:data];

    // Step 3: Setup color (Optional)
    // colors maybe not setup, will be generated automatically
    UIColor * color1 = [UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:1.0];
    UIColor * color2 = [UIColor colorWithRed:0.0 green:1.0 blue:0.0 alpha:1.0];
    UIColor * color3 = [UIColor colorWithRed:0.0 green:0.5 blue:0.0 alpha:1.0];
    UIColor * color4 = [UIColor colorWithRed:1.0 green:0.0 blue:1.0 alpha:1.0];
    UIColor * color5 = [UIColor colorWithRed:0.0 green:0.0 blue:1.0 alpha:1.0];

    NSMutableArray *colors = [NSMutableArray arrayWithObjects:  color1, color2,
                                                                color3, color4,
                                                                color5, nil];
    [semiCircleChart setColors:colors];

    // Step 4: Setup Chart Title
    [semiCircleChart setTitle:@"Browser Shared"];

    // Step 5: Determine whether chart element text is shown or not.
    //          SHOW_PORTION_TEXT to show element's name
    //          SHOW_PORTION_VALUE to show element's value
    //          DONT_SHOW_PORTION   to show element without any text
    semiCircleChart.showPortionTextType = SHOW_PORTION_TEXT;

本文地址:https://www.codercto.com/soft/d/9634.html

卓有成效的程序员

卓有成效的程序员

Neal Ford / 熊节 / 机械工业出版社 / 2009-3 / 45.00元

《卓有成效的程序员》就是讲述如何在开发软件的过程中变得更加高效。同时,《卓有成效的程序员》的讲述将会跨语言和操作系统:很多技巧的讲述都会伴随多种程序语言的例子,并且会跨越三种主要的操作系统,Windows(多个版本),Mac OS X以及 *-nix (Unix或者Linux)。 《卓有成效的程序员》讨论的是程序员个体的生产力,而不是团队的生产力问题,所以它不会涉及方法论(好吧,可能总会在......一起来看看 《卓有成效的程序员》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具