Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit 7baa81d

Browse files
committed
Merge pull request #93 from sbhhbs/master
able to customize text on no data label
2 parents e2bf960 + 2421271 commit 7baa81d

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

BEMSimpleLineGraph.podspec.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "BEMSimpleLineGraph",
3+
"version": "3.3",
4+
"summary": "Elegant Line Graphs for iOS (charting library)",
5+
"description": "BEMSimpleLineGraph lets you create highly customizable line graphs / charts for iOS.",
6+
"homepage": "https://github.com/Boris-Em/BEMSimpleLineGraph",
7+
"screenshots": [
8+
"http://s27.postimg.org/txboc1peb/BEMSimple_Line_Graph_Main.png",
9+
"http://s21.postimg.org/3lkbvgp53/GIF_Touch_Report.gif"
10+
],
11+
"license": {
12+
"type": "MIT",
13+
"file": "LICENSE"
14+
},
15+
"authors": {
16+
"Boris Emorine": "[email protected]"
17+
},
18+
"platforms": {
19+
"ios": "6.0"
20+
},
21+
"requires_arc": true,
22+
"source": {
23+
"git": "https://github.com/Boris-Em/BEMSimpleLineGraph.git",
24+
"tag": "v3.2"
25+
},
26+
"source_files": [
27+
"Classes",
28+
"Classes/**/*.{h,m}"
29+
]
30+
}

Classes/BEMSimpleLineGraphView.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,11 @@
362362
@return The boolean value indicating the availability of the NO DATA label. */
363363
- (BOOL)noDataLabelEnableForLineGraph:(BEMSimpleLineGraphView *)graph;
364364

365+
/** Optional method to control the text to be displayed on NO DATA label
366+
@param graph The graph object for the NO DATA label
367+
@return The text to show on the NO DATA label. */
368+
- (NSString *)noDataLabelTextForLineGraph:(BEMSimpleLineGraphView *)graph;
369+
365370
/** Optional method to set the static padding distance between the graph line and the whole graph
366371
@param graph The graph object requesting the padding value.
367372
@return The padding value of the graph. */

Classes/BEMSimpleLineGraphView.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,12 @@ - (void)layoutNumberOfPoints {
222222
self.noDataLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.viewForBaselineLayout.frame.size.width, self.viewForBaselineLayout.frame.size.height)];
223223
self.noDataLabel.backgroundColor = [UIColor clearColor];
224224
self.noDataLabel.textAlignment = NSTextAlignmentCenter;
225-
self.noDataLabel.text = @"No Data";
225+
NSString *noDataText;
226+
if ([self.delegate respondsToSelector:@selector(noDataLabelTextForLineGraph:)])
227+
{
228+
noDataText = [self.delegate noDataLabelTextForLineGraph:self];
229+
}
230+
self.noDataLabel.text = noDataText ?: NSLocalizedString(@"No Data", nil);
226231
self.noDataLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:15];
227232
self.noDataLabel.textColor = self.colorLine;
228233
[self.viewForBaselineLayout addSubview:self.noDataLabel];

0 commit comments

Comments
 (0)