Method: Tk::BLT::PlotComponent::Legend.new

Defined in:
lib/tkextlib/blt/component.rb

.new(chart, keys = {}) ⇒ Object



924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
# File 'lib/tkextlib/blt/component.rb', line 924

def self.new(chart, keys={})
  obj = nil
  LegenedID_TBL.mutex.synchronize{
    unless (obj = LegenedID_TBL[chart.path])
      (obj = self.allocate).instance_eval{
        @parent = @chart = chart
        @cpath = @chart.path
        @path = @id = 'crosshairs'
        Legend::LegenedID_TBL[@cpath] = self
      }
    end
  }
  chart.legend_configure(keys) if obj && ! keys.empty?
  obj
end