From 6739c249e7bf3cf7d2132b2aa49b6faf6bebec29 Mon Sep 17 00:00:00 2001
From: Randy Morgan
-This is a short cut method to set the end anchor position.
-
-Creates a new TwoCellAnchor object.
-
-This is a short cut method to set the start anchor position.
+Creates a new TwoCellAnchor object and sets up a reference to the from and
+to markers in the graphic_frame’s chart.
-Creates a new TwoCellAnchor object +Creates a new TwoCellAnchor object and sets up a reference to the from and +to markers in the graphic_frame’s chart. That means that you can do +stuff like c = worksheet.add_chart Axlsx::Chart c.start_at 5, 9
@@ -411,13 +366,20 @@ Creates a new TwoCellAnchor object+This is passed to the graphic frame for instantiation. must be Chart or a +subclass of Chart +
++the col, row to start at +
++the col, row to end at +
+-31 -32 -33 34 35 36 37 38 -39 -40 -41 -42 -43 -44+39
# File 'lib/axlsx/drawing/two_cell_anchor.rb', line 31 +# File 'lib/axlsx/drawing/two_cell_anchor.rb', line 34 def initialize(drawing, chart_type, ) @drawing = drawing drawing.anchors << self - @from, @to = Marker.new, Marker.new(:col => 5, :row=>10) @graphic_frame = GraphicFrame.new(self, chart_type, ) - - self.start_at([:start_at][0], [:start_at][1]) if [:start_at].is_a?(Array) - self.end_at([:end_at][0], [:end_at][1]) if [:end_at].is_a?(Array) - # passing a reference to our start and end markers for convenience - # this lets us access the markers directly from the chart. - @graphic_frame.chart.send(:start_at=, @from) - @graphic_frame.chart.send(:end_at=, @to) end
- - - (Marker) end_at(x, y) - - - -
-This is a short cut method to set the end anchor position -
- - -
- - - -65 -66 -67 -68 -69- |
-
- # File 'lib/axlsx/drawing/two_cell_anchor.rb', line 65 - -def end_at(x, y) - @to.col = x - @to.row = y - @to -end -- |
-
- - - (Marker) start_at(x, y) - - - -
-This is a short cut method to set the start anchor position -
- - -
- - - -55 -56 -57 -58 -59- |
-
- # File 'lib/axlsx/drawing/two_cell_anchor.rb', line 55 - -def start_at(x, y) - @from.col = x - @from.row = y - @from -end -- |
-
+
- (String) to_xml(xml) @@ -1065,22 +825,22 @@ The document builder instance this objects xml will be added to.
-74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86+47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59
# File 'lib/axlsx/drawing/two_cell_anchor.rb', line 74 +# File 'lib/axlsx/drawing/two_cell_anchor.rb', line 47 def to_xml(xml) #build it for now, break it down later! @@ -1106,7 +866,7 @@ The document builder instance this objects xml will be added to. -- cgit v1.2.3