I hesitate to post this as I've made no significant progress. I should probably step away for a day. I am attempting to average values by date for use in HighStock charts. The data is in the form of json. The issue arises when I have two sets of data on the same day, I need to average these values based on the date. On a given day there may be 0,1, or 2 values. Days with no values need to be null rather than 0 so there highstock will show the gap. I have been trying to work on a js solution to the problem. Conceptually this seems very easy; group by date, sum and divide by the length. But I have not made good progress. Here is a fiddle without my blunders. Any assistance or nudge in the right direction is appreciated.
{
"nfdrs": {
"row": [{
"@num": "141",
"sta_id": "350920",
"sta_nm": "HEHE 1",
"latitude": "44.9559",
"longitude": "-121.4991",
"nfdr_dt": "08\/10\/2016",
"nfdr_tm": "13",
"nfdr_type": "O",
"mp": "1",
"msgc": "7C2P2",
"one_hr": "5",
"ten_hr": "6",
"hu_hr": "11",
"th_hr": "10",
"xh_hr": "8",
"ic": "28",
"kbdi": "304",
"sc": "8",
"ec": "14",
"bi": "27",
"sl": "3-",
"lr": "0",
"lo": "0",
"hr": "0",
"ho": "0",
"fl": "19",
"hrb": "60",
"wdy": "78",
"adj": "M"
}, {
"@num": "142",
"sta_id": "352108",
"sta_nm": "WARM SPRINGS BASE",
"latitude": "44.7795",
"longitude": "-121.2501",
"nfdr_dt": "08\/10\/2016",
"nfdr_tm": "13",
"nfdr_type": "O",
"mp": "1",
"msgc": "7A2A2",
"one_hr": "5",
"ten_hr": "6",
"hu_hr": "8",
"th_hr": "8",
"xh_hr": "3",
"ic": "19",
"kbdi": "587",
"sc": "34",
"ec": "2",
"bi": "22",
"sl": "2",
"lr": "0",
"lo": "0",
"hr": "0",
"ho": "0",
"fl": "16",
"hrb": "5",
"wdy": "60",
"adj": "L"
},
And, how to do I control the size of that code sample while including all of the code>
nfdr_dtis the date. What about the keys to the values? Which value do I average?