From 6739c249e7bf3cf7d2132b2aa49b6faf6bebec29 Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Wed, 23 Nov 2011 12:28:10 +0900 Subject: -refactoring chart position and axis data/category for chart. -additional specs and documentation improvements. --- doc/Axlsx/Drawing.html | 156 +++++++++++++++++++++---------------------------- 1 file changed, 65 insertions(+), 91 deletions(-) (limited to 'doc/Axlsx/Drawing.html') diff --git a/doc/Axlsx/Drawing.html b/doc/Axlsx/Drawing.html index 82b6dd0a..1d2bce32 100644 --- a/doc/Axlsx/Drawing.html +++ b/doc/Axlsx/Drawing.html @@ -99,14 +99,16 @@ Note:

The recommended way to manage drawings is to use the Worksheet.add_chart -method, specifying the chart class, start and end marker locations. +method.

A Drawing is a canvas for charts. Each worksheet has a single drawing that -can specify multiple anchors which reference charts. +manages anchors. The anchors reference the charts via graphical frames. +This is not a trivial relationship so please do follow the advice in the +note. see README for an example of how to create a chart.

@@ -120,8 +122,6 @@ can specify multiple anchors which reference charts.
  • Worksheet#add_chart
  • -
  • TwoCellAnchor
  • -
  • Chart
  • @@ -151,7 +151,8 @@ can specify multiple anchors which reference charts.

    -A collection of anchors for this drawing. +A collection of anchors for this drawing only TwoCellAnchors are supported +in this version.

    @@ -487,15 +488,15 @@ The worksheet that owns this drawing
     
     
    -67
    -68
    -69
    -70
     71
    -72
    +72 +73 +74 +75 +76 -
    # File 'lib/axlsx/drawing/drawing.rb', line 67
    +      
    # File 'lib/axlsx/drawing/drawing.rb', line 71
     
     def initialize(worksheet)
       DataTypeValidator.validate "Drawing.worksheet", Worksheet, worksheet
    @@ -527,7 +528,8 @@ The worksheet that owns this drawing
     

    -A collection of anchors for this drawing +A collection of anchors for this drawing only TwoCellAnchors are supported +in this version

    @@ -555,12 +557,12 @@ A collection of anchors for this drawing
     
     
    -39
    -40
    -41
    +43 +44 +45
    -
    # File 'lib/axlsx/drawing/drawing.rb', line 39
    +      
    # File 'lib/axlsx/drawing/drawing.rb', line 43
     
     def anchors
       @anchors
    @@ -612,12 +614,12 @@ An array of charts that are associated with this drawing’s anchors
           
     
     
    -43
    -44
    -45
    +47 +48 +49
    -
    # File 'lib/axlsx/drawing/drawing.rb', line 43
    +      
    # File 'lib/axlsx/drawing/drawing.rb', line 47
     
     def charts
       @anchors.map { |a| a.graphic_frame.chart }
    @@ -670,12 +672,12 @@ collection.
           
     
     
    -47
    -48
    -49
    +51 +52 +53
    -
    # File 'lib/axlsx/drawing/drawing.rb', line 47
    +      
    # File 'lib/axlsx/drawing/drawing.rb', line 51
     
     def index
       @worksheet.workbook.drawings.index(self)
    @@ -727,12 +729,12 @@ The part name for this drawing
           
     
     
    -55
    -56
    -57
    +59 +60 +61
    -
    # File 'lib/axlsx/drawing/drawing.rb', line 55
    +      
    # File 'lib/axlsx/drawing/drawing.rb', line 59
     
     def pn
       "#{DRAWING_PN % (index+1)}"
    @@ -784,17 +786,17 @@ The drawing’s relationships.
           
     
     
    -63
    -64
    -65
    -66
     67
     68
     69
    -70
    +70 +71 +72 +73 +74
    -
    # File 'lib/axlsx/drawing/drawing.rb', line 63
    +      
    # File 'lib/axlsx/drawing/drawing.rb', line 67
     
     def relationships
       r = Relationships.new
    @@ -851,12 +853,12 @@ The relational part name for this drawing
           
     
     
    -59
    -60
    -61
    +63 +64 +65
    -
    # File 'lib/axlsx/drawing/drawing.rb', line 59
    +      
    # File 'lib/axlsx/drawing/drawing.rb', line 63
     
     def rels_pn
       "#{DRAWING_RELS_PN % (index+1)}"
    @@ -908,12 +910,12 @@ The relation reference id for this drawing
           
     
     
    -51
    -52
    -53
    +55 +56 +57
    -
    # File 'lib/axlsx/drawing/drawing.rb', line 51
    +      
    # File 'lib/axlsx/drawing/drawing.rb', line 55
     
     def rId
       "rId#{index+1}"
    @@ -965,12 +967,12 @@ The worksheet that owns the drawing
           
     
     
    -34
    -35
    -36
    +38 +39 +40
    -
    # File 'lib/axlsx/drawing/drawing.rb', line 34
    +      
    # File 'lib/axlsx/drawing/drawing.rb', line 38
     
     def worksheet
       @worksheet
    @@ -1001,7 +1003,8 @@ The worksheet that owns the drawing
       
    Note:

    -The recommended way to manage charts is to use Worksheet.add_chart. +The recommended way to manage charts is to use Worksheet.add_chart. Please +refer to that method for documentation.

    @@ -1014,41 +1017,14 @@ Adds a chart to the drawing.
    -

    Parameters:

    -
      -
    • - - chart_type - - - (Chart) - - - - — -

      -The class of the chart to be added to the drawing -

      -
      - -
    • - -
    • - - options - - - (Hash) - - - (defaults to: {}) - - -
    • - -
    +

    See Also:

    +
    @@ -1056,17 +1032,15 @@ The class of the chart to be added to the drawing
     
     
    -79
    -80
    -81
     82
    -83
    +83 +84 +85
    -
    # File 'lib/axlsx/drawing/drawing.rb', line 79
    +      
    # File 'lib/axlsx/drawing/drawing.rb', line 82
     
     def add_chart(chart_type, options={})
    -  DataTypeValidator.validate "Drawing.chart_type", Chart, chart_type 
       TwoCellAnchor.new(self, chart_type, options)
       @anchors.last.graphic_frame.chart
     end
    @@ -1114,17 +1088,17 @@ Serializes the drawing
           
     
     
    -116
    -117
     118
     119
     120
     121
     122
    -123
    +123 +124 +125
    -
    # File 'lib/axlsx/drawing/drawing.rb', line 116
    +      
    # File 'lib/axlsx/drawing/drawing.rb', line 118
     
     def to_xml
       builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
    @@ -1145,7 +1119,7 @@ Serializes the drawing
     
         
         
    -- 
    cgit v1.2.3