Move events stats in Statistics, add ticket distribution

This commit is contained in:
Stella 2014-03-09 16:16:22 +02:00
parent 257226273b
commit 2e1dcd33fe
20 changed files with 968 additions and 159 deletions

View file

@ -9,8 +9,8 @@ var registrations = '<%= h @registered %>';
var attendees = '<%= h @attendees %>';
var data = [
{"status":"Registrations","value": registrations, "percent": ""},
{"status":"Attendees","value": attendees, "percent": d3.round(attendees/registrations * 100)+"%"}
{"status":"Did Not Attend","value": registrations-attendees, "percent": ""},
{"status":"Attended","value": attendees, "percent": d3.round(attendees/registrations * 100)+"%"}
];
var vis = d3.select("#registrations_attendees")
@ -49,26 +49,7 @@ var arcs = vis.selectAll("g.slice")
.data(pie)
.enter()
.append("svg:g")
.attr("class", "slice")
.on("mouseover", function(d) {
d3.select(this).select("path").transition()
.duration(200)
.attr("d", arcOver)
textTop.text(d3.select(this).datum().data.status)
.attr("y", -10);
textBottom.text( d3.select(this).datum().data.value)
.attr("y", 10);
})
.on("mouseout", function(d) {
d3.select(this).select("path").transition()
.duration(100)
.attr("d", arc);
textTop.text("Registered: " + registrations)
.attr("y", -10);
textBottom.text("Attended: " + attendees);
});
.attr("class", "slice");
arcs.append("svg:path")
.attr("fill", function(d, i) { return color(i); } )
@ -92,5 +73,5 @@ legend.append("text")
.attr("x", 24)
.attr("y", 9)
.attr("dy", ".35em")
.text(function(d) { return "Total " + d.status; });
.text(function(d) { return "Total " + d.status + " (" + d.value + ")"; });
</script>