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});
Source: stackoverflow.com
Related Query
- How can I dynamically generate javascript within a script tag using jade and express
- How can I add an image as the fill for a circle dynamically in javascript using d3
- How can we create multi column table using multi array JSON using d3 and crossfilter javascript frameworks
- How can I generate as many colors as I want using d3?
- How can I show a graph using d3 force layout with initial positions set and no movement at all?
- How can I construct a tree using d3 and its force layout?
- Using Javascript D3 library, how can I determine mouse position in data set of an area element on mousemove event?
- How can i get the startAngle and endAngle of each arc in the sunburst example using d3.js?
- How to add all but a few columns using javascript and d3
- How can I add images in the nodes of a D3 Sankey diagram, using the rcv and networkD3 packages in R?
- How to select and deselect a svg line and change its color on selection and deselection using d3.js and javascript , jquery?
- How can I run a javascript as a node.js script without the DOM?
- How can I dynamically change the position and the size of direction arrows on a directed d3.js force layout?
- How can I offset the source and target points of a bezier curve using D3's link generator?
- How do I graph an individual line for each the groups within a Javascript map object using D3.js
- Using d3 in meteor on windows 8.1, how can I display a world map, zoomed in on the US, with country borders and US state borders?
- How can I connect Storm and D3.js using Redis and Flask?
- How to get url for D3.json dynamically using input tag type=file?
- how can i group JSON data and generate a graph of each group in D3js
- How can you select and highlight all points on a line(s) using d3?
- How can I get the source code from a page using javascript
- How to animate points, appearing one-by-one, in the window using JavaScript and D3?
- how can i dynamically calculate and draw canvas border from user input
- How to dynamically append text to svg using d3 and Ajax?
- How to generate graphs and charts on the fly using web2py
- How can I move a d3 map using zoom behavior and transforms?
- How can I set max value(range) for y-axis and bar width of a bar chart using nvd3.js
- How to create an interactive graph network of resources, diseases, triggers and treatments using JavaScript
- How can I access and change variable in concatenated text of tooltip using D3/javascript?
- I have created tree using D3 tree js. Point is I need the value of top and left of each tree node. How can I get the top and left value of tree node?
More Query from same tag
- How to rearrange the DOM order of svg elements based on their data values in a dynamically changing d3 vis?
- Multilevel Hierarchical Edge Bundling
- How to create a grouped waterfall chart in amchart?
- d3 - reading JSON data instead of CSV file
- Checking node and it's all childrens on the basis of id
- D3.js tooltips not displaying correctlty when generated with Highcharts
- d3 - improper y axis tick marks
- How do I convert my scale of numbers (0-50,000) to a radial progress chart number?
- D3 Data Visualisation aligning tick labels and rect
- HTML update on slider
- D3 Not able to render a simple line
- Simple curved text within a circle
- Passing parameter with OnClick to Filemaker Using D3
- d3 time format hour adding 7 hours
- How can I change the attribute of the circle node in d3.js?
- using php output in the javascript variable gives Cannot read property 'forEach' of undefined error
- Multiples with x/y axis and mouseover example - line path shows wrong values
- How to adjust node size based on value in diagonalNetwork of networkD3
- how to import data into d3js correctly
- Add data to server-side SVG with D3
- d3.js add a label in the center of a path
- d3.js gives NAN in path.line
- Making circles appear and disappear with mouseenter and mouseleave in d3.js
- Topojson file with US census bureau divisions
- Javascript D3 position tooltip to chart
- How can i Show values over the NVD3 historical bar?
- How to assign colors according to a index in d3.js?
- D3 Word Wrap on Zoomable Treemap
- My topojson won't display when adapting a canonical example
- in D3.js how to add/remove datapoints at the same time?