     ctx    = canvas.getContext("2d")
     bar    = new Chart( ctx ).Bar(@dataForBarChart())
 
-  shuffleArray: (o) ->
-    i = o.length
-    while i
-      j = Math.floor(Math.random() * i)
-      x = o[--i]
-      o[i] = o[j]
-      o[j] = x
-    o
-
-  dataForPieChart: ->
-    # # data structure
-    # volumeByRooms = [
-    #     {
-    #       room: "kitchen"
-    #       volume: 300
-    #     }
-    #   ]
-    data = @volumeSortedBy("room")
-    ary = []
-    colors = ["#995577", "#005588", "#668833", "#CC7700", "#665533", "#883355",
-              "#AA3333", "#446633", "3388AA", "#CC5522", "#999988", "#DD5555"]
-    @shuffleArray(colors)
-    for item in data
-      numOfColors = colors.length
-      color = colors.pop(Math.floor(Math.random() * numOfColors))
-      obj =
-        value:     item.volume
-        color:     color
-        highlight: color
-        label:     item.room
-      ary.push(obj)
-    ary
-
-  dataForBarChart: ->
-    labels:   ["January", "February", "March", "April", "May", "June", "July"]
-    datasets: [
-        {
-          label:           "My First dataset"
-          fillColor:       "rgba(220,220,220,0.5)"
-          strokeColor:     "rgba(220,220,220,0.8)"
-          highlightFill:   "rgba(220,220,220,0.75)"
-          highlightStroke: "rgba(220,220,220,1)"
-          data:            [65, 59, 80, 81, 56, 55, 40]
-        }
-        {
-          label:           "My Second dataset"
-          fillColor:       "rgba(151,187,205,0.5)"
-          strokeColor:     "rgba(151,187,205,0.8)"
-          highlightFill:   "rgba(151,187,205,0.75)"
-          highlightStroke: "rgba(151,187,205,1)"
-          data:            [28, 48, 40, 19, 86, 27, 90]
-        }
-      ]
-
   addRecord: (record) ->
     records = React.addons.update(@state.records, { $unshift: [record] })
     @setState records: records

    index = @state.records.indexOf record
    records = React.addons.update(@state.records, { $splice: [[index, 1, newRecord]] })
    @replaceState records: records

  # For sorting an array of objects by the value of specified property.
  predicateBy: (prop) ->

  render: ->
    React.DOM.canvas
      id:    @props.id
      style: { height: 200, width: 300 }

R = React.DOM

