score:2

Accepted answer

like @stretch0 mentioned you are missing the key to the object

res.render('drawgraph', { dataobj: dataobj});

but this alone wont solve the problem. you will have to use json.stringify in the pug template to display the object

from

 var data = #{dataobj}; 

to

var data = !{json.stringify(dataobj)};

`#{} escapes characters, so inorder to avoid escaping you can use !{}

score:0

you're passing an object into an object without a key.

try res.render('drawgraph', { dataobj: dataobj});


Related Query

More Query from same tag