Tag: d3.js

d3 custom time interval

The following code rounds up a data series and sums up amounts with a minute interval. var nested_data = d3.nest() .key(function(d) {return d3.time.minute(d.date)}) .rollup(function(a) {return d3.sum(a, function(d) {return d.amount})}) .entries(data); However, is there a way to have a custom interval of say 5 minutes? Perhaps using a range with a step ?

NVD3 line chart having color gradients according to positive/negative values

I am having trouble on nvd3. What i want is having color variations according to y values. . Something like this : But the color should vary with the y axis. Example : If the y axis value is negative – red, positive – green neutral – yellow This is the code for the similar […]

dc.js month chart uneven spacing between bars

I am creating a chart using dc.js and as you can see the spacing between the months are different. The most notable is between February and March because February only has 28 days. How do I have even spacing between the months? chart //dimensions .height(250) .margins({top: 10, right: 50, bottom: 25, left: 50}) //x-axis .x(d3.time.scale().domain(domain)) […]

Rotating Globe Choropleth in D3

I’m trying to make a chorolpleth with a rotating globe in d3. I can get the globe to render out fine but I can’t get the countries to fill with the proper color scale. Longer explanation. I basically started with Mike Bostock’s code for the spinning globe found here: http://bl.ocks.org/mbostock/6747043 I’ve got some economic data […]

javascript or css library for animated tiles

I have a series of pictures, which I would like to display on a webpage simulating the effect that these pictures are floating in space. Each of these pictures would take turn popping up into a larger size. Are there any javascript or css libraries that may assist in getting this done? An example of […]

nvd3 line chart not shown properly. (dots and shaded area)

So I am using nvd3 and I want to show 2 lines in one line chart. I know the code is alright as I am trying it on the live code of nvd3 and it works fine. I read in many places though that the code they use on the nvd3 live code is not […]

visualize transfer of interest over time in d3.js

Update: Revised JSON and added code sample to show the Nodes at a size based on the interest data but I still cannot get the “stroke-width” to work. Any help appreciated. I would like to use d3.js to build a dendrogram describing the distribution/transfer of real property interest over time and I need some help. […]

d3 cloud layout – show all tags

[background] currently I’m working on a little web project for data visualization and I want to use create a tagcloud or wordcloud with cloud layout of the javascript d3 framework (d3 cloud layout). I’ve built some examples that almost satisfy my requirements. The only thing that doesn’t work is, that some words/tags aren’t displayed in […]

d3 plotting multiple time series with different time scales

I’m new to d3 (& javascript) and want to ask if I can plot 2 different time series on the same chart if they have different time scales – e.g. one is monthly data and the other is yearly Does d3 handle the x-axis ticks automatically? Can you point me to some example code? Any […]

How to keep the duplicate letters in enter() when update() already have that letter in D3

I have been learning D3 these days. Quite a lot fun. There is a question: When there is a letter, like “o” in the update(), then the enter() has two same letters “o o” and the current update() would have only one “o”. But how do I make the duplicated letters in the enter() still […]