   componentDidUpdate: ->
     el = @getDOMNode()
 
-    max = _.max @props.data, (d) -> d.value
+    if not @props.max
+      console.log "calc max"
+      max = _.max @props.data, (d) -> d.value
+      max = max.value
+    else
+      max = @props.max
 
     x = d3.scale.linear()
-          .domain [0, max.value]
+          .domain [0, max]
           .range [0, @props.width]
 
     y = d3.scale.ordinal()

  render: ->
    dom.div null,
      dom.h3 null, 'Deaths'
      React.createElement(BarChart, {data: @chartData()})
)

WeaponUsagePanel = React.createClass(

  displayName: 'BarChart'
  getDefaultProps: ->
    return {
      max: null
      width: 300
      height: 150
      padding: 30
