Add charts for popular attendees/suggestions
This commit is contained in:
23
js/components/AttendeeFrequencyChart.js
Normal file
23
js/components/AttendeeFrequencyChart.js
Normal file
@ -0,0 +1,23 @@
|
||||
var React = require('react');
|
||||
|
||||
var BarChart = require('../components/BarChart');
|
||||
|
||||
module.exports = React.createClass({
|
||||
displayName: "AttendeeFrequencyChart",
|
||||
render: function() {
|
||||
var data = [];
|
||||
for (var i = 0; i < this.props.popularAttendees.length; i++) {
|
||||
var attendee = this.props.popularAttendees[i];
|
||||
data.push({
|
||||
'label': attendee.Name,
|
||||
'value': attendee.Popularity
|
||||
});
|
||||
}
|
||||
|
||||
data.sort(function(a, b){return b.value - a.value;});
|
||||
|
||||
return (
|
||||
<BarChart title="Attendee Frequency" data={data}/>
|
||||
);
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user