iOS 中的饼图。
// self.topPieChart = [[FFCPieChart alloc] initWithFrame:...];
// self.middlePieChart = etc.
DataItem *dataItem1 = [[DataItem alloc] initWithColor:[UIColor redColor]
value:0.4];
DataItem *dataItem2 = [[DataItem alloc] initWithColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"texture"]]
value:02.5];
self.topPieChart.palette = [FFCPieChart grayPalette];
[self.topPieChart setDataItems:@[@2, @3, @4, dataItem1, dataItem2]];
self.topPieChart.strokeColor = [UIColor whiteColor];
self.topPieChart.strokeWidth = 2;
self.pieChart.palette = [FFCPieChart warmPalette];
[self.pieChart setDataItems:@[@1, @2, @3, @4]];
self.pieChart.pieHole = 0.5;
self.pieChart.strokeWidth = 0.5;
[self.bottomPieChart setDataItems:@[@17, @27, @13, @24, @32, @12, @55]];
要运行示例项目,先从仓库克隆,然后在 Example 目录中运行 pod install
。
FFCPieChart 将通过 CocoaPods 提供。要安装它,在此之前,将以下行添加到您的 Podfile 中:
pod "FFCPieChart"
FFCPieChart 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。