               .domain([0, @maximum_y])
               .range([@series_height, 0])
 
-      #Create X axis
       xAxis = d3.svg.axis()
                     .scale(xScale)
                     .orient("bottom")
 
-      #Define Y axis
       yAxis = d3.svg.axis()
                     .scale(yScale)
                     .orient("left")
                     .tickValues([])
                     .tickSize(0)
 
-      #Create xAxis
       xAxisGroup = @svg.append("g")
-                       .attr("class", "x_axis")
-                       .attr("transform", "translate(0,#{@series_height})")
-                       .call(xAxis)
+                                 .attr("class", "x_axis")
+                                 .attr("transform", "translate(0,#{@series_height})")
+                                 .call(xAxis)
 
-      #Create Y axis
       yAxisGroup = @svg.append("g")
-                       .attr("class", "y_axis")
-                       .call(yAxis)
+                                 .attr("class", "y_axis")
+                                 .call(yAxis)
 
       xAxisLabel = xAxisGroup.append("text")
-                             .attr("class","label")
-                             .attr("x", @width/2)
-                             .attr("y", 35)
-                             .text("#{I18n.t('output_elements.storage_chart.installed_capacity')}")
-                             .attr("text-anchor","middle")
+                               .attr("class","label")
+                               .attr("x", @width/2)
+                               .attr("y", 35)
+                               .text("#{I18n.t('output_elements.storage_chart.installed_capacity')}")
+                               .attr("text-anchor","middle")
 
       yAxisLabel = yAxisGroup.append("text")
                                .attr("class","label")

      p2g_curve  = filter_on_y_values p2g_curve, @maximum_y
      p2h_curve  = filter_on_y_values p2h_curve, @maximum_y

      @tracker = [{"x": tracker_value, "y": 0}, {"x": tracker_value, "y": @maximum_y}]

      #Create scale functions
      xScale = d3.scale.linear()
              .domain([0, @maximum_x])
              .range([0, @width])

                               .attr("text-anchor","middle")
                               .attr("transform", (d) -> "rotate(-90)" )

      lineFunction = d3.svg.line()
                             .x( (d) ->  xScale(d.x) )
                             .y( (d) ->  yScale(d.y) )
                             .interpolate("basis")

      @svg.selectAll('path.serie')
                  .data(theData)
                  .enter()
                  .append('path')
                  .attr("d", (d) -> lineFunction(d.values) )
                  .attr("stroke", (d) -> d.color )
                  .attr("stroke-width", 3)
                  .attr("fill", "none");

      @svg.append("path")
               .attr("id", "tracker")
               .style("stroke-dasharray", ("3, 3"))
               .attr("d", lineFunction(@tracker))
               .attr("stroke", "red")
               .attr("stroke-width", 2)
               .attr("fill", "none")

      @svg.append("g").append("text")
               .attr("class", "indicative_label")
               .attr("x", 320)
               .attr('y', 0-300)
               .text("#{I18n.t('output_elements.storage_chart.indicative')}")
               .attr("transform", (d) -> "rotate(45)" )

      legendGroup = @svg.append("g")
                         .attr("class", "legend")
                         .attr("transform", "translate(0,#{@series_height + legend_margin})")

      legendItem = legendGroup.append("svg")

      legendMargin = @width/legend_columns

      legendItem.selectAll('rect')
                 .data(theData)
                 .enter()
                 .append('rect')
                 .attr("x", (d,i) -> i%2 * legendMargin )
                 .attr("y", (d,i) -> Math.floor(i / 2) * 15 )
                 .attr("width", "10")
                 .attr("height", "10")
                 .attr("fill", (d) -> d.color )

      legendItem.selectAll('text')
                  .data(theData)
                  .enter()
                  .append('text')
                  .attr("class", "legend_label")
                  .attr("x", (d,i) -> i%2 * legendMargin + 15 )
                  .attr("y", (d,i) -> Math.floor(i / 2) * 15 + 10 )
                  .text((d) -> "#{I18n.t(d.label)}" )

    refresh: =>
      tracker_value = if @gquery.future_value() < @maximum_x then @gquery.future_value() else 200
