Skip to content

Commit

Permalink
function names for custom view changed
Browse files Browse the repository at this point in the history
  • Loading branch information
dhirenthirani committed Jul 28, 2016
1 parent 088f49b commit 6d89f6d
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 16 deletions.
Binary file not shown.
13 changes: 7 additions & 6 deletions dr-ChartsExample/dr-ChartsExample/PageViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ - (NSMutableArray *)dataForLineWithLineNumber:(NSInteger)lineNumber{
return [[NSMutableArray alloc] init];
}

- (UIView *)viewForLineChartTouchWithXValue:(NSNumber *)xValue andYValue:(NSNumber *)yValue{
- (UIView *)customViewForLineChartTouchWithXValue:(NSNumber *)xValue andYValue:(NSNumber *)yValue{
UIView *view = [[UIView alloc] init];
[view setBackgroundColor:[UIColor whiteColor]];
[view.layer setCornerRadius:4.0F];
Expand Down Expand Up @@ -270,7 +270,7 @@ - (NSNumber *)valueInPieChartWithIndex:(NSInteger)index{
return [NSNumber numberWithLong:random() % 100];
}

- (UIView *)viewForPieChartTouchWithValue:(NSNumber *)value{
- (UIView *)customViewForPieChartTouchWithValue:(NSNumber *)value{
UIView *view = [[UIView alloc] init];
[view setBackgroundColor:[UIColor whiteColor]];
[view.layer setCornerRadius:4.0F];
Expand Down Expand Up @@ -328,7 +328,7 @@ - (NSNumber *)valueInStackChartWithIndex:(NSInteger)index{
return [NSNumber numberWithLong:random() % 100];
}

- (UIView *)viewForStackChartTouchWithValue:(NSNumber *)value{
- (UIView *)customViewForStackChartTouchWithValue:(NSNumber *)value{
UIView *view = [[UIView alloc] init];
[view setBackgroundColor:[UIColor whiteColor]];
[view.layer setCornerRadius:4.0F];
Expand Down Expand Up @@ -360,6 +360,7 @@ - (void)createBarChart{
[barChartView setDataSource:self];
[barChartView setDelegate:self];
[barChartView setLegendViewType:LegendTypeHorizontal];
[barChartView setShowCustomMarkerView:TRUE];
[barChartView drawBarGraph];

[self.view addSubview:barChartView];
Expand Down Expand Up @@ -402,7 +403,7 @@ - (NSMutableArray *)yDataForBarWithBarNumber:(NSInteger)barNumber{
return array;
}

- (UIView *)viewForBarChartTouchWithValue:(NSNumber *)value{
- (UIView *)customViewForBarChartTouchWithValue:(NSNumber *)value{
UIView *view = [[UIView alloc] init];
[view setBackgroundColor:[UIColor whiteColor]];
[view.layer setCornerRadius:4.0F];
Expand All @@ -428,7 +429,7 @@ - (void)didTapOnBarChartWithValue:(NSString *)value{
NSLog(@"Bar Chart: %@",value);
}

#pragma Mark CreatePieChart
#pragma Mark CreateCircularChart
- (void)createCircularChart{
CircularChart *chart = [[CircularChart alloc] initWithFrame:CGRectMake(0, header_height, WIDTH(self.view), (HEIGHT(self.view) - header_height)/2)];
[chart setDataSource:self];
Expand Down Expand Up @@ -464,7 +465,7 @@ - (NSNumber *)valueInCircularChartWithIndex:(NSInteger)index{
return [NSNumber numberWithLong:random() % 100];
}

- (UIView *)viewForCircularChartTouchWithValue:(NSNumber *)value{
- (UIView *)customViewForCircularChartTouchWithValue:(NSNumber *)value{
UIView *view = [[UIView alloc] init];
[view setBackgroundColor:[UIColor whiteColor]];
[view.layer setCornerRadius:4.0F];
Expand Down
2 changes: 1 addition & 1 deletion dr-charts/Classes/BarChart/BarChart.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
//Set y-Axis data for each item in a Bar Chart

@optional
- (UIView *)viewForBarChartTouchWithValue:(NSNumber *)value;
- (UIView *)customViewForBarChartTouchWithValue:(NSNumber *)value;
//Set Custom View for touch on each item in a Bar Chart

@end
Expand Down
2 changes: 1 addition & 1 deletion dr-charts/Classes/BarChart/BarChart.m
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ - (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{

#pragma mark Show Custom Marker
- (void)showCustomMarkerViewWithData:(NSString *)data{
self.customMarkerView = [self.dataSource viewForBarChartTouchWithValue:[NSNumber numberWithFloat:data.floatValue]];
self.customMarkerView = [self.dataSource customViewForBarChartTouchWithValue:[NSNumber numberWithFloat:data.floatValue]];

if (self.customMarkerView != nil) {
CGRect rect = CGPathGetBoundingBox(touchedLayer.path);
Expand Down
2 changes: 1 addition & 1 deletion dr-charts/Classes/CircularChart/CircularChart.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
//Default value is 0

@optional
- (UIView *)viewForCircularChartTouchWithValue:(NSNumber *)value;
- (UIView *)customViewForCircularChartTouchWithValue:(NSNumber *)value;
//Set Custom View for touch on each item in a Circular Chart

@end
Expand Down
2 changes: 1 addition & 1 deletion dr-charts/Classes/CircularChart/CircularChart.m
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ - (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{

#pragma mark Show Custom Marker
- (void)showCustomMarkerViewWithData:(NSString *)data{
self.customMarkerView = [self.dataSource viewForCircularChartTouchWithValue:[NSNumber numberWithFloat:data.floatValue]];
self.customMarkerView = [self.dataSource customViewForCircularChartTouchWithValue:[NSNumber numberWithFloat:data.floatValue]];

if (self.customMarkerView != nil) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
//Set Value for each item in a Stack Chart

@optional
- (UIView *)viewForStackChartTouchWithValue:(NSNumber *)value;
- (UIView *)customViewForStackChartTouchWithValue:(NSNumber *)value;
//Set Custom View for touch on each item in a Stack Chart

@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ - (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{

#pragma mark Show Custom Marker
- (void)showCustomMarkerViewWithData:(NSString *)data withTouchedPoint:(CGPoint)point{
self.customMarkerView = [self.dataSource viewForStackChartTouchWithValue:[NSNumber numberWithFloat:data.floatValue]];
self.customMarkerView = [self.dataSource customViewForStackChartTouchWithValue:[NSNumber numberWithFloat:data.floatValue]];

if (self.customMarkerView != nil) {
CGRect rect = CGPathGetBoundingBox(touchedLayer.path);
Expand Down
2 changes: 1 addition & 1 deletion dr-charts/Classes/LineChart/MultiLineGraphView.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ typedef enum {
//If LineType is LineParallelYAxis, Set xData for the Line on Line Graph

@optional
- (UIView *)viewForLineChartTouchWithXValue:(NSNumber *)xValue andYValue:(NSNumber *)yValue;
- (UIView *)customViewForLineChartTouchWithXValue:(NSNumber *)xValue andYValue:(NSNumber *)yValue;
//Set Custom View for touch on each item in a Line Chart

@end
Expand Down
2 changes: 1 addition & 1 deletion dr-charts/Classes/LineChart/MultiLineGraphView.m
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ - (void)findValueForTouch:(UITouch *)touch{
[self.marker setHidden:YES];
[self.marker removeFromSuperview];

self.customMarkerView = [self.dataSource viewForLineChartTouchWithXValue:[NSNumber numberWithFloat:xData.floatValue] andYValue:[NSNumber numberWithFloat:yData.floatValue]];
self.customMarkerView = [self.dataSource customViewForLineChartTouchWithXValue:[NSNumber numberWithFloat:xData.floatValue] andYValue:[NSNumber numberWithFloat:yData.floatValue]];

if (selectedPoint.x + WIDTH(self.customMarkerView) > self.graphScrollView.contentSize.width) {
selectedPoint.x -= WIDTH(self.customMarkerView);
Expand Down
2 changes: 1 addition & 1 deletion dr-charts/Classes/PieChart/PieChart.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
//Default Value is 0

@optional
- (UIView *)viewForPieChartTouchWithValue:(NSNumber *)value;
- (UIView *)customViewForPieChartTouchWithValue:(NSNumber *)value;
//Set Custom View for touch on each item in a Pie Chart

@end
Expand Down
2 changes: 1 addition & 1 deletion dr-charts/Classes/PieChart/PieChart.m
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ - (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{

#pragma mark Show Custom Marker
- (void)showCustomMarkerViewWithData:(NSString *)data withTouchedPoint:(CGPoint)point{
self.customMarkerView = [self.dataSource viewForPieChartTouchWithValue:[NSNumber numberWithFloat:data.floatValue]];
self.customMarkerView = [self.dataSource customViewForPieChartTouchWithValue:[NSNumber numberWithFloat:data.floatValue]];

if (self.customMarkerView != nil) {
CGFloat viewX = 0;
Expand Down
Binary file not shown.

0 comments on commit 6d89f6d

Please sign in to comment.