Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make frame a public property on NKLineChart. #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions WatchChart Extension/NKWatchChart/NKLineChart.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

@interface NKLineChart : NSObject

@property (nonatomic) CGRect frame;

// Background color of the chart
@property (nonatomic) UIColor *chartBackgroundColor;
// Array of `LineChartData` objects, one for each line.
Expand Down
8 changes: 7 additions & 1 deletion WatchChart Extension/NKWatchChart/NKLineChart.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

@interface NKLineChart ()

@property (nonatomic) CGRect frame;
@property (nonatomic) NSMutableArray *chartLineArray;

// Array of line path, one for each line.
Expand Down Expand Up @@ -71,6 +70,13 @@ - (void)setupDefaultValues
_axisWidth = 1.f;
}

- (void)setFrame:(CGRect)frame
{
_frame = frame;
_chartCavanWidth = frame.size.width - _chartMargin * 2;
_chartCavanHeight = frame.size.height - _chartMargin * 2;
}

#pragma mark - Draw Chart

- (UIImage *)drawImage
Expand Down