Skip to content

Commit ad26e63

Browse files
authored
Merge pull request #3847 from danielgindi/dataset-values-accessors
Renamed `values` to `entries` to reflect the property's type
2 parents cf36285 + 636f623 commit ad26e63

File tree

60 files changed

+183
-176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+183
-176
lines changed

ChartsDemo-iOS/Objective-C/Demos/AnotherBarChartViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ - (void)setDataCount:(int)count range:(double)range
9797
if (_chartView.data.dataSetCount > 0)
9898
{
9999
set1 = (BarChartDataSet *)_chartView.data.dataSets[0];
100-
set1.values = yVals;
100+
[set1 replaceEntries:yVals];
101101
[_chartView.data notifyDataChanged];
102102
[_chartView notifyDataSetChanged];
103103
}
104104
else
105105
{
106-
set1 = [[BarChartDataSet alloc] initWithValues:yVals label:@"DataSet"];
106+
set1 = [[BarChartDataSet alloc] initWithEntries:yVals label:@"DataSet"];
107107
set1.colors = ChartColorTemplates.vordiplom;
108108
set1.drawValuesEnabled = NO;
109109

ChartsDemo-iOS/Objective-C/Demos/BarChartViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,13 @@ - (void)setDataCount:(int)count range:(double)range
148148
if (_chartView.data.dataSetCount > 0)
149149
{
150150
set1 = (BarChartDataSet *)_chartView.data.dataSets[0];
151-
set1.values = yVals;
151+
[set1 replaceEntries: yVals];
152152
[_chartView.data notifyDataChanged];
153153
[_chartView notifyDataSetChanged];
154154
}
155155
else
156156
{
157-
set1 = [[BarChartDataSet alloc] initWithValues:yVals label:@"The year 2017"];
157+
set1 = [[BarChartDataSet alloc] initWithEntries:yVals label:@"The year 2017"];
158158
[set1 setColors:ChartColorTemplates.material];
159159
set1.drawIconsEnabled = NO;
160160

ChartsDemo-iOS/Objective-C/Demos/BubbleChartViewController.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,17 @@ - (void)setDataCount:(int)count range:(double)range
115115
[yVals3 addObject:[[BubbleChartDataEntry alloc] initWithX:i y:val size:size]];
116116
}
117117

118-
BubbleChartDataSet *set1 = [[BubbleChartDataSet alloc] initWithValues:yVals1 label:@"DS 1"];
118+
BubbleChartDataSet *set1 = [[BubbleChartDataSet alloc] initWithEntries:yVals1 label:@"DS 1"];
119119
set1.drawIconsEnabled = NO;
120120
[set1 setColor:ChartColorTemplates.colorful[0] alpha:0.50f];
121121
[set1 setDrawValuesEnabled:YES];
122122

123-
BubbleChartDataSet *set2 = [[BubbleChartDataSet alloc] initWithValues:yVals2 label:@"DS 2"];
123+
BubbleChartDataSet *set2 = [[BubbleChartDataSet alloc] initWithEntries:yVals2 label:@"DS 2"];
124124
set2.iconsOffset = CGPointMake(0, 15);
125125
[set2 setColor:ChartColorTemplates.colorful[1] alpha:0.50f];
126126
[set2 setDrawValuesEnabled:YES];
127127

128-
BubbleChartDataSet *set3 = [[BubbleChartDataSet alloc] initWithValues:yVals3 label:@"DS 3"];
128+
BubbleChartDataSet *set3 = [[BubbleChartDataSet alloc] initWithEntries:yVals3 label:@"DS 3"];
129129
[set3 setColor:ChartColorTemplates.colorful[2] alpha:0.50f];
130130
[set3 setDrawValuesEnabled:YES];
131131

ChartsDemo-iOS/Objective-C/Demos/CandleStickChartViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ - (void)setDataCount:(int)count range:(double)range
105105
[yVals1 addObject:[[CandleChartDataEntry alloc] initWithX:i shadowH:val + high shadowL:val - low open:even ? val + open : val - open close:even ? val - close : val + close icon: [UIImage imageNamed:@"icon"]]];
106106
}
107107

108-
CandleChartDataSet *set1 = [[CandleChartDataSet alloc] initWithValues:yVals1 label:@"Data Set"];
108+
CandleChartDataSet *set1 = [[CandleChartDataSet alloc] initWithEntries:yVals1 label:@"Data Set"];
109109
set1.axisDependency = AxisDependencyLeft;
110110
[set1 setColor:[UIColor colorWithWhite:80/255.f alpha:1.f]];
111111

ChartsDemo-iOS/Objective-C/Demos/ColoredLineChartViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ - (LineChartData *)dataWithCount:(int)count range:(double)range
8686
[yVals addObject:[[ChartDataEntry alloc] initWithX:i y:val]];
8787
}
8888

89-
LineChartDataSet *set1 = [[LineChartDataSet alloc] initWithValues:yVals label:@"DataSet 1"];
89+
LineChartDataSet *set1 = [[LineChartDataSet alloc] initWithEntries:yVals label:@"DataSet 1"];
9090

9191
set1.lineWidth = 1.75;
9292
set1.circleRadius = 5.0;

ChartsDemo-iOS/Objective-C/Demos/CombinedChartViewController.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ - (LineChartData *)generateLineData
170170
[entries addObject:[[ChartDataEntry alloc] initWithX:index + 0.5 y:(arc4random_uniform(15) + 5)]];
171171
}
172172

173-
LineChartDataSet *set = [[LineChartDataSet alloc] initWithValues:entries label:@"Line DataSet"];
173+
LineChartDataSet *set = [[LineChartDataSet alloc] initWithEntries:entries label:@"Line DataSet"];
174174
[set setColor:[UIColor colorWithRed:240/255.f green:238/255.f blue:70/255.f alpha:1.f]];
175175
set.lineWidth = 2.5;
176176
[set setCircleColor:[UIColor colorWithRed:240/255.f green:238/255.f blue:70/255.f alpha:1.f]];
@@ -202,13 +202,13 @@ - (BarChartData *)generateBarData
202202
[entries2 addObject:[[BarChartDataEntry alloc] initWithX:0.0 yValues:@[@(arc4random_uniform(13) + 12), @(arc4random_uniform(13) + 12)]]];
203203
}
204204

205-
BarChartDataSet *set1 = [[BarChartDataSet alloc] initWithValues:entries1 label:@"Bar 1"];
205+
BarChartDataSet *set1 = [[BarChartDataSet alloc] initWithEntries:entries1 label:@"Bar 1"];
206206
[set1 setColor:[UIColor colorWithRed:60/255.f green:220/255.f blue:78/255.f alpha:1.f]];
207207
set1.valueTextColor = [UIColor colorWithRed:60/255.f green:220/255.f blue:78/255.f alpha:1.f];
208208
set1.valueFont = [UIFont systemFontOfSize:10.f];
209209
set1.axisDependency = AxisDependencyRight;
210210

211-
BarChartDataSet *set2 = [[BarChartDataSet alloc] initWithValues:entries2 label:@""];
211+
BarChartDataSet *set2 = [[BarChartDataSet alloc] initWithEntries:entries2 label:@""];
212212
set2.stackLabels = @[@"Stack 1", @"Stack 2"];
213213
set2.colors = @[
214214
[UIColor colorWithRed:61/255.f green:165/255.f blue:255/255.f alpha:1.f],
@@ -243,7 +243,7 @@ - (ScatterChartData *)generateScatterData
243243
[entries addObject:[[ChartDataEntry alloc] initWithX:index + 0.25 y:(arc4random_uniform(10) + 55)]];
244244
}
245245

246-
ScatterChartDataSet *set = [[ScatterChartDataSet alloc] initWithValues:entries label:@"Scatter DataSet"];
246+
ScatterChartDataSet *set = [[ScatterChartDataSet alloc] initWithEntries:entries label:@"Scatter DataSet"];
247247
set.colors = ChartColorTemplates.material;
248248
set.scatterShapeSize = 4.5;
249249
[set setDrawValuesEnabled:NO];
@@ -265,7 +265,7 @@ - (CandleChartData *)generateCandleData
265265
[entries addObject:[[CandleChartDataEntry alloc] initWithX:index + 1 shadowH:90.0 shadowL:70.0 open:85.0 close:75.0]];
266266
}
267267

268-
CandleChartDataSet *set = [[CandleChartDataSet alloc] initWithValues:entries label:@"Candle DataSet"];
268+
CandleChartDataSet *set = [[CandleChartDataSet alloc] initWithEntries:entries label:@"Candle DataSet"];
269269
[set setColor:[UIColor colorWithRed:80/255.f green:80/255.f blue:80/255.f alpha:1.f]];
270270
set.decreasingColor = [UIColor colorWithRed:142/255.0 green:150/255.0 blue:175/255.0 alpha:1.0];
271271
set.shadowColor = UIColor.darkGrayColor;
@@ -290,7 +290,7 @@ - (BubbleChartData *)generateBubbleData
290290
[entries addObject:[[BubbleChartDataEntry alloc] initWithX:index + 0.5 y:y size:size]];
291291
}
292292

293-
BubbleChartDataSet *set = [[BubbleChartDataSet alloc] initWithValues:entries label:@"Bubble DataSet"];
293+
BubbleChartDataSet *set = [[BubbleChartDataSet alloc] initWithEntries:entries label:@"Bubble DataSet"];
294294
[set setColors:ChartColorTemplates.vordiplom];
295295
set.valueTextColor = UIColor.whiteColor;
296296
set.valueFont = [UIFont systemFontOfSize:10.f];

ChartsDemo-iOS/Objective-C/Demos/CubicLineChartViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,13 @@ - (void)setDataCount:(int)count range:(double)range
126126
if (_chartView.data.dataSetCount > 0)
127127
{
128128
set1 = (LineChartDataSet *)_chartView.data.dataSets[0];
129-
set1.values = yVals1;
129+
[set1 replaceEntries:yVals1];
130130
[_chartView.data notifyDataChanged];
131131
[_chartView notifyDataSetChanged];
132132
}
133133
else
134134
{
135-
set1 = [[LineChartDataSet alloc] initWithValues:yVals1 label:@"DataSet 1"];
135+
set1 = [[LineChartDataSet alloc] initWithEntries:yVals1 label:@"DataSet 1"];
136136
set1.mode = LineChartModeCubicBezier;
137137
set1.cubicIntensity = 0.2;
138138
set1.drawCirclesEnabled = NO;

ChartsDemo-iOS/Objective-C/Demos/HalfPieChartViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ - (void)setDataCount:(int)count range:(double)range
101101
[values addObject:[[PieChartDataEntry alloc] initWithValue:(arc4random_uniform(mult) + mult / 5) label:parties[i % parties.count]]];
102102
}
103103

104-
PieChartDataSet *dataSet = [[PieChartDataSet alloc] initWithValues:values label:@"Election Results"];
104+
PieChartDataSet *dataSet = [[PieChartDataSet alloc] initWithEntries:values label:@"Election Results"];
105105
dataSet.sliceSpace = 3.0;
106106
dataSet.selectionShift = 5.0;
107107

ChartsDemo-iOS/Objective-C/Demos/HorizontalBarChartViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@ - (void)setDataCount:(int)count range:(double)range
127127
if (_chartView.data.dataSetCount > 0)
128128
{
129129
set1 = (BarChartDataSet *)_chartView.data.dataSets[0];
130-
set1.values = yVals;
130+
[set1 replaceEntries:yVals];
131131
[_chartView.data notifyDataChanged];
132132
[_chartView notifyDataSetChanged];
133133
}
134134
else
135135
{
136-
set1 = [[BarChartDataSet alloc] initWithValues:yVals label:@"DataSet"];
136+
set1 = [[BarChartDataSet alloc] initWithEntries:yVals label:@"DataSet"];
137137

138138
set1.drawIconsEnabled = NO;
139139

ChartsDemo-iOS/Objective-C/Demos/LineChart1ViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,13 @@ - (void)setDataCount:(int)count range:(double)range
145145
if (_chartView.data.dataSetCount > 0)
146146
{
147147
set1 = (LineChartDataSet *)_chartView.data.dataSets[0];
148-
set1.values = values;
148+
[set1 replaceEntries: values];
149149
[_chartView.data notifyDataChanged];
150150
[_chartView notifyDataSetChanged];
151151
}
152152
else
153153
{
154-
set1 = [[LineChartDataSet alloc] initWithValues:values label:@"DataSet 1"];
154+
set1 = [[LineChartDataSet alloc] initWithEntries:values label:@"DataSet 1"];
155155

156156
set1.drawIconsEnabled = NO;
157157

0 commit comments

Comments
 (0)