Skip to content

Invalid values when using allKeys and allValues to generate mutable array for x and y #2

@DevGW

Description

@DevGW

I am receiving a json array from an api that that contains numeric days (30) as keys and values for each of those days as values.

Here's what I have:

self.queryChart.xElements = [[NSMutableArray alloc] initWithArray:[[stats allValues] mutableCopy]]; self.queryChart.yElements = [[NSMutableArray alloc] initWithArray:[[stats allKeys] mutableCopy]];

However I'm getting an "Invalid Values" message on the chart.

The values are:
Stats: {
1 = 4;
10 = 4;
12 = 10;
13 = 9;
14 = 12;
15 = 25;
16 = 12;
17 = 13;
18 = 14;
19 = 16;
2 = 2;
20 = 6;
21 = 4;
22 = 6;
23 = 3;
24 = 2;
25 = 10;
26 = 8;
27 = 2;
28 = 4;
29 = 5;
3 = 2;
30 = 1;
31 = 1;
4 = 3;
5 = 1;
6 = 5;
7 = 0;
8 = 4;
9 = 2;
}

any guidance would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions