Get data from existing chart

29 views
Skip to first unread message

Vinay Lobo

unread,
Nov 6, 2021, 6:48:06 PM11/6/21
to d3-js
Need to get data from a d3 chart (preloaded with data in a SASS platform).

Tried the following
var cart_data = d3.selectAll("#NvD3Chart7").datum();
var cart_data = d3.selectAll("#NvD3Chart7").data();

But just get undefined.

Gordon Woodhull

unread,
Nov 7, 2021, 8:13:41 AM11/7/21
to d3...@googlegroups.com
You will need to dig deeper in the DOM, selecting elements within the SVG element, which does not usually have data bound to itself.

It may help to consult the nvd3 source to figure out what to select.


On Nov 6, 2021, at 6:48 PM, Vinay Lobo <vinay.l...@gmail.com> wrote:

Need to get data from a d3 chart (preloaded with data in a SASS platform).
--
You received this message because you are subscribed to the Google Groups "d3-js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to d3-js+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/d3-js/97ada6fe-b141-4263-9d80-2fa03adecd23n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages