lib/write_xlsx/chart/axis.rb in write_xlsx-0.72.3.beta1 vs lib/write_xlsx/chart/axis.rb in write_xlsx-0.73.0

- old
+ new

@@ -9,11 +9,11 @@ include Writexlsx::Utility attr_accessor :defaults, :reverse attr_accessor :min, :max attr_accessor :minor_unit, :major_unit, :minor_unit_type, :major_unit_type - attr_accessor :log_base, :crossing, :position, :label_position, :visible + attr_accessor :log_base, :crossing, :position, :position_axis, :label_position, :visible attr_accessor :num_format, :num_format_linked, :num_font attr_accessor :major_gridlines, :minor_gridlines, :major_tick_mark # # Convert user defined axis values into axis instance. @@ -29,10 +29,11 @@ @major_unit = args[:major_unit] @minor_unit_type = args[:minor_unit_type] @major_unit_type = args[:major_unit_type] @log_base = args[:log_base] @crossing = args[:crossing] + @position_axis = args[:position_axis] @label_position = args[:label_position] @num_format = args[:num_format] @num_format_linked = args[:num_format_linked] @visible = args[:visible] || 1 @@ -48,11 +49,24 @@ # Only use the first letter of bottom, top, left or right. @position = args[:position] @position = @position.downcase[0, 1] if @position + # Set the position for a category axis on or between the tick marks. + if @position_axis + if @position_axis == 'on_tick' + @position_axis = 'midCat' + elsif @position_axis == 'between' + # Doesn't neet to be modified. + else + # Otherwise use the default value. + @position_axis = nil + end + end + # Set the font properties if present. @num_font = @chart.convert_font_args(args[:num_font]) + @name_font = @chart.convert_font_args(args[:name_font]) end # # Write the <c:numberFormat> element. Note: It is assumed that if a user # defined number format is supplied (i.e., non-default) then the sourceLinked