From 083614cd24dfe3271d62a2f6b364f52f104d2b36 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Wed, 28 Jul 2021 11:24:58 -0300 Subject: [PATCH] add centerCircleBackgroundColor property --- .../Charts/PieChart/Controller/PieChartController.h | 1 + .../Charts/PieChart/Controller/PieChartController.m | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Sources/ObjectiveChart/Charts/PieChart/Controller/PieChartController.h b/Sources/ObjectiveChart/Charts/PieChart/Controller/PieChartController.h index 08a5cec..77f33c0 100644 --- a/Sources/ObjectiveChart/Charts/PieChart/Controller/PieChartController.h +++ b/Sources/ObjectiveChart/Charts/PieChart/Controller/PieChartController.h @@ -15,6 +15,7 @@ /*! @brief Value that controls the thickness of pieces in the pie chart*/ @property CGFloat centerCircleRadius; +@property UIColor* centerCircleBackgroundColor; @end diff --git a/Sources/ObjectiveChart/Charts/PieChart/Controller/PieChartController.m b/Sources/ObjectiveChart/Charts/PieChart/Controller/PieChartController.m index 1945d75..fb2e07c 100644 --- a/Sources/ObjectiveChart/Charts/PieChart/Controller/PieChartController.m +++ b/Sources/ObjectiveChart/Charts/PieChart/Controller/PieChartController.m @@ -14,10 +14,20 @@ @implementation PieChartController @synthesize backgroundView; @synthesize database; @synthesize centerCircleRadius; +@synthesize centerCircleBackgroundColor; //Delegate @synthesize radius; +- (instancetype)init +{ + self = [super init]; + if (self) { + centerCircleBackgroundColor = [UIColor blackColor]; + } + return self; +} + - (void)layoutSubviews { [super layoutSubviews]; @@ -44,7 +54,7 @@ - (void)layoutSubviews { } UIView *centerCircleView = [[UIView alloc] init]; - centerCircleView.backgroundColor = [UIColor blackColor]; + centerCircleView.backgroundColor = centerCircleBackgroundColor; centerCircleView.layer.cornerRadius = centerCircleRadius/2; centerCircleView.translatesAutoresizingMaskIntoConstraints = NO; [self addSubview: centerCircleView];