your function (with the hardcoded data) works for me...
[{"id":"f3242d57.06f4f","type":"ui_chart","z":"553814a2.1248ec","name":"","group":"dce9e7a2.d20c78","order":5,"width":0,"height":0,"label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"x":1550,"y":580,"wires":[[]]},{"id":"20e90dd8.d49882","type":"inject","z":"553814a2.1248ec","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1240,"y":580,"wires":[["67feff68.ff6d"]]},{"id":"67feff68.ff6d","type":"function","z":"553814a2.1248ec","name":"","func":"var m2 = {};\n\n//var dd = String (msg.payload);\nm2.labels = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64];\nm2.series = [1];\n//test data\nm2.data = [\n[170, 169, 166, 162, 153, 133, 101, 76, 62, 55, 57, 65, 77, 88, 95, 98, 101, 103, 106, 109, 110, 112, 114, 114, 114, 112, 111, 111, 110, 110, 108, 107, 106, 105, 104, 106, 107, 108, 109, 110, 112, 112, 113, 114, 114, 114, 114, 112, 110, 109, 107, 106, 104, 103, 99, 95, 88, 79, 71, 65, 67, 78, 99, 130]\n];\n\nvar j;\nfor (j = 0; j < msg.payload.length; j++) {\n //m2.data [0][j]= dd.charCodeAt(j) ; // [m2[j]];\n m2.data[0][j] = msg.payload[j];\n}\nreturn { payload: [m2] };\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1400,"y":580,"wires":[["f3242d57.06f4f"]]},{"id":"dce9e7a2.d20c78","type":"ui_group","name":"Object detection","tab":"5132060d.4cde48","order":1,"disp":true,"width":"7","collapse":false},{"id":"5132060d.4cde48","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]
can you expand the data[0][...] array = is it filled with numeric values like this...