I was wondering how I need to prepare the data so it is ready for core-plot.
- one line per year
- dayOfYear in the x-axis
- value on the y-axis
My x-axis has 366 points (Each day of the year). At the moment I have a dictionary that looks like this
2009 (year) = {
151 (dayofyear) = 5 (value);
192 = 25;
206 = 5;
234 = 20;
235 = 20;
255 = 20;
262 = 10;
276 = 10;
290 = 10;
298 = 7;
310 = 1;
338 = 3;
354 = 5;
362 = 5;
};
2010 = {
114 = 7;
119 = 3;
144 = 7;
17 = 5;
187 = 10;
198 = 7;
205 = 10;
212 = 10;
213 = 20;
215 = 5;
247 = 10;
248 = 10;
256 = 10;
262 = 7;
264 = 10;
277 = 10;
282 = 3;
284 = 7;
47 = 5;
75 = 7;
99 = 7;
};
2011 = {
260 = 10;
};
I think core-plot needs an array doesn’t it? How would you pack this to be the most efficient?
I have actually changed the structure to this.
A dictionary with the year as the key and an array for each point containing the dayofyear and the value.
That way the implementation was very easy