D3js: When to use .datum() and .data()?

I think the documentation gives a good answer to this question: https://github.com/mbostock/d3/wiki/Selections#wiki-datum. Basically, the point is that in some cases you are not interested in the enter/exit sets when you do a selection. If this is the case, which often seems to be the case for the full chart, you use datum. Update: It depends: … Read more

How to customize color in pie chart of NVD3

If you want to use specific color for pie chart.color(function(d){ return d.data.color }); Then, organize your data as: [ { key: “Cumulative Return”, values: [ { “label”: “One”, “value” : 29.765957771107, “color” : “#8c564b” } , { “label”: “Three”, “value” : 32.807804682612, “color” : “#e377c2” } ] } ]

Real time line graph with nvd3.js

You probably want to look at: D3 Real-Time streamgraph (Graph Data Visualization), especially the link of the answer: http://bost.ocks.org/mike/path/ In general, I see two ways to deal with the vertical transition problem: oversampling having some linear interpolation between the real point, and the smaller the interval between points, the more “horizontal” the vertical transition will … Read more

NVD3 chart fails to calculate legend text length in Chrome, since Window.getComputedStyle does not return font-size correctly

Sorry, I’m not very fluent with D3, but a few ideas off the top of my head that might be of some help. Have you tried using the d3.select() method and applying solely the font-size this way, to see if you can narrow down that the font/text selector combination is problem? Maybe assign an id … Read more