examples/scatterplot/axes.rb
def plot

    # add x_axis
    @x_svg = @chart.svg.append("g")
    @x_svg.attr("transform", "translate(0, #{@chart.height - @chart.padding})")
      .call(&style)
      .call(@x_axis)

    # add y_axis
    @y_svg = @chart.svg.append("g")
    @y_svg.attr("transform", "translate(#{@chart.padding}, 0)")
      .call(&style)
      .call(@y_axis)

  end
#--------------------------------------------------------------------------------------
# Plot the x and y axis
#--------------------------------------------------------------------------------------
Plot the x and y axis
Plot the x and y axis
def plot
    @x_svg = @chart.svg.append("g")
    @x_svg.attr("transform", "translate(0, #{@chart.height - @chart.padding})")
      .call(&style)
      .call(@x_axis)
    @y_svg = @chart.svg.append("g")
    @y_svg.attr("transform", "translate(#{@chart.padding}, 0)")
      .call(&style)
      .call(@y_axis)
  end
def plot @x_svg = @chart . svg . append ( "g" ) @x_svg . attr ( "transform" , "translate(0, #{@chart.height - @chart.padding})" ) . call ( & style ) . call ( @x_axis ) @y_svg = @chart . svg . append ( "g" ) @y_svg . attr ( "transform" , "translate(#{@chart.padding}, 0)" ) . call ( & style ) . call ( @y_axis ) end
Plot the x and y axis
Plot the x and y axis
# add x_axis # add y_axis