examples/bar_chart/bar_chart.rb
def remove_bar

    @dataset.shift

    @svg.selectAll("rect")
      .data(@dataset) { |d| d[:key] }
      .exit(nil)
      .transition(nil)
      .duration(500)
      .remove(nil)

    @svg.selectAll("text")
      .data(@dataset) { |d| d[:key] }
      .exit(nil)
      .remove(nil)

    update_bars
    update_labels

  end
#--------------------------------------------------------------------------------------
# Removes a bar from the plot
#--------------------------------------------------------------------------------------
Removes a bar from the plot
Removes a bar from the plot
def remove_bar
    @dataset.shift
    @svg.selectAll("rect")
      .data(@dataset) { |d| d[:key] }
      .exit(nil)
      .transition(nil)
      .duration(500)
      .remove(nil)
    @svg.selectAll("text")
      .data(@dataset) { |d| d[:key] }
      .exit(nil)
      .remove(nil)
    update_bars
    update_labels
  end
def remove_bar @dataset . shift @svg . selectAll ( "rect" ) . data ( @dataset ) { | d | d [ :key ] } . exit ( nil ) . transition ( nil ) . duration ( 500 ) . remove ( nil ) @svg . selectAll ( "text" ) . data ( @dataset ) { | d | d [ :key ] } . exit ( nil ) . remove ( nil ) update_bars update_labels end
Removes a bar from the plot
Removes a bar from the plot