score:0
Accepted answer
Your transform function should return a string, but the curly braces are confusing the arrow function...
> (d => "Hello, " + d)("World!") // without braces
'Hello, World!'
> (d => {"Hello, " + d})("World!") // with braces
undefined
> (function(d) {return "Hello, " + d;})("World!") // function
'Hello, World!'
I suspect the arrow function is trying to build an object to return, but the syntax is wrong (no key: val pair) -- so it's returning undefined
instead. If you remove the curly braces, or use a function, it should work as expected.
Source: stackoverflow.com
Related Query
- d3 Grouped Chart 1st level not looping
- D3 Chart values are not grouped (from JSON load)
- d3 grouped bar chart update pattern not working
- Negative values not showing in grouped bar chart
- d3 line chart x, y not in the same level of a data structure, how to set x, y function?
- Right Axis not displaying on Dual Axis Grouped Bar and Line Chart D3
- Label not center grouped bar chart lest than 5
- Stacked Bar Chart to Grouped Bar Chart transition not working
- NVD3 chart fails to calculate legend text length in Chrome, since Window.getComputedStyle does not return font-size correctly
- D3 transition looping throwing Uncaught TypeError: t.call is not a function
- d3 accessing nested data in grouped bar chart
- Add event listener per nodes level on d3 chart
- Pie chart click issue - click not detected
- Adding a filter in dc.js / Crossfilter not updating the chart
- Grouped stack chart with D3.js
- Angular ng-click's inside a dynamically created d3 chart are not working
- Adding Error Bars to Grouped Bar Chart with D3.js
- D3 brushing on grouped bar chart
- d3.js chart not updated with new data
- Making a grouped bar chart using d3.js
- Making a grouped bar chart when my groups are varied sizes?
- How to add space between bars in a grouped bar chart in a nvd3 grouped multibar chart?
- Y axis label not displaying large numbers - Multi-Bar Chart
- D3.js not displaying chart
- Trouble using DC.js (crossfilter and d3 convenience library) - bar chart not showing values
- d3 v4 line chart transition not working
- D3: Create a grouped bar chart from json objects
- Unneeded white space before the 1st bar in D3 bar chart
- Interactive sorting of grouped bar chart in D3js
- nvd3 line chart not shown properly. (dots and shaded area)
More Query from same tag
- d3.js how to properly massage my data for tree layout?
- How do I fix the timeScale of d3 line chart?
- Bars not hidding properly
- d3 mercator, geo, and path methods
- How do I make specific elements appear on top of others in D3.js?
- javascript: array of objects within an array of objects
- Problem to show dynamic text on mouseover in D3.js and json file?
- Focused part shows wrong chart (NVD3)
- d3: Brush with an input field
- D3 curved lines reversed
- How to get position of empty SVG group?
- Trying build graph using d3.js
- Adding an image to a chart in the background
- Inserting a line break in D3 force layout node labels
- d3.js v5 How do I truncate tick text?
- Responsive D3 Bar chart appending new <text> when resizing
- Upgrade from d3 3.1.9 to 3.1.10 break animations
- Space between y-axis and y-axis labels d3js
- Button with text label: How do I keep the hover color even when over text label?
- Export SVG elements to PDF?
- D3 Javascript loop doesn't render
- D3 force layout forceY does not map to range
- d3.js: "Cannot read property 'weight' of undefined" when manually defining both nodes and links for force layout
- D3.js force layout: How to isolate node groups?
- How to add svg on top of another svg in d3,js
- code failing with $ not defined: Uncaught reference error and Uncaught TypeError: Cannot read property 'getAttribute' of null
- Can you set style in d3 via something like foo.style({color:blah, background:blah})?
- d3 make a group draggable
- Displaying images on hovering over points in d3.js scatter plot
- Custom grouping of d3 data