Skip to content

Commit

Permalink
Merge pull request #9 from tianon/r2d3
Browse files Browse the repository at this point in the history
fixed a few small inconsistencies/inefficiencies
  • Loading branch information
alangrafu committed Jul 8, 2013
2 parents ac5904e + 3d8b03d commit 0d35248
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/radar-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ var RadarChart = {

d.forEach(function(y, x){
dataValues = [];
d3.select(id+" g").selectAll(".nodes")
g.selectAll(".nodes")
.data(y, function(j, i){
dataValues.push([
cfg.w/2*(1-(parseFloat(Math.max(j.value, 0))/cfg.maxValue)*cfg.factor*Math.sin(i*cfg.radians/total)),
cfg.h/2*(1-(parseFloat(Math.max(j.value, 0))/cfg.maxValue)*cfg.factor*Math.cos(i*cfg.radians/total))
]);
});
dataValues.push(dataValues[0]);
g.select(id+" g").selectAll(".area")
g.selectAll(".area")
.data([dataValues])
.enter()
.append("polygon")
Expand Down Expand Up @@ -96,7 +96,7 @@ var RadarChart = {


d.forEach(function(y, x){
d3.select(id+" g").selectAll(".nodes")
g.selectAll(".nodes")
.data(y).enter()
.append("svg:circle").attr("class", "serie"+series)
.attr('r', cfg.radius)
Expand Down

0 comments on commit 0d35248

Please sign in to comment.