It seems that the three variables aren't being set in prior code, so are empty values.
Try changing var snowdata = ['.substr($snowjson, 0, -1).'];
var sleetdata = ['.substr($sleetjson, 0, -1).'];
var frzdata = ['.substr($frzjson, 0, -1).'];
to var snowdata = ['.@substr($snowjson, 0, -1).'];
var sleetdata = ['.@substr($sleetjson, 0, -1).'];
var frzdata = ['.@substr($frzjson, 0, -1).'];
to suppress those Deprecated messages.
A better approach would be to preprocess the values, then you don't need to suppress the error messages
var snowdata = ['.empty($snowjson)?"":substr($snowjson, 0, -1).'];
var sleetdata = ['. empty($sleetjson)?"":substr($sleetjson, 0, -1).'];
var frzdata = ['.empty($frzjson)?"":substr($frzjson, 0, -1).'];