       .attr('cx', @x)
       .attr('cy', @y)
     
-    chartRegion.attr('class', 'dot')
+    dot = chartRegion.attr('class', 'dot')
       .attr('cx', @x)
       .attr('cy', @y)
-      .style 'fill', (d, i) =>
-        if @period and @colorize
-          @colors Math.floor(d.x / @period)
-        else
-          'black'
+    
+    if @colorize
+      dot.style 'fill', (d, i) =>
+          if @period
+            @colors Math.floor(d.x / @period)
+          else
+            'black'
   
   render: =>
     xExtent = d3.extent @data, (d) -> d.x

      .attr('height', @height)
      # .attr('clip-path', 'url(#clip)')
    
    @colors = d3.scale.category10()
    
    if @parent
      @rawData = @parent.rawData

        sum = 0
        count = 0
        
        for p in @rawData
          if p.x > max
            break
          
          if p.x >= min and p.x <= max
            sum += p.y
            count++
        
        avg = sum / count
        @data.push
