lib/write_xlsx/chart.rb in write_xlsx-1.10.0 vs lib/write_xlsx/chart.rb in write_xlsx-1.10.1
- old
+ new
@@ -68,11 +68,11 @@
# Set the gradient fill properties for the series.
@gradient = gradient_properties(params[:gradient])
# Map deprecated Spreadsheet::WriteExcel fill colour.
- fill = params[:color] ? { :color => params[:color] } : params[:fill]
+ fill = params[:color] ? { color: params[:color] } : params[:fill]
@fill = fill_properties(fill)
# Pattern fill overrides solid fill.
@fill = nil if ptrue?(@pattern)
@@ -88,17 +88,17 @@
def params_to_border(params)
line_weight = params[:line_weight]
# Map deprecated Spreadsheet::WriteExcel line_weight.
border = params[:border]
- border = { :width => swe_line_weight(line_weight) } if line_weight
+ border = { width: swe_line_weight(line_weight) } if line_weight
# Map deprecated Spreadsheet::WriteExcel line_pattern.
if params[:line_pattern]
pattern = swe_line_pattern(params[:line_pattern])
if pattern == 'none'
- border = { :none => 1 }
+ border = { none: 1 }
else
border[:dash_type] = pattern
end
end
@@ -430,12 +430,12 @@
end
end
# Set the up and down bar properties.
@up_down_bars = {
- :_up => Chartline.new(params[:up]),
- :_down => Chartline.new(params[:down])
+ _up: Chartline.new(params[:up]),
+ _down: Chartline.new(params[:down])
}
end
#
# Set properties for the chart drop lines.
@@ -693,37 +693,37 @@
@y2_axis.defaults = y2_axis_defaults
end
def x_axis_defaults
{
- :num_format => 'General',
- :major_gridlines => { :visible => 0 }
+ num_format: 'General',
+ major_gridlines: { visible: 0 }
}
end
def y_axis_defaults
{
- :num_format => 'General',
- :major_gridlines => { :visible => 1 }
+ num_format: 'General',
+ major_gridlines: { visible: 1 }
}
end
def x2_axis_defaults
{
- :num_format => 'General',
- :label_position => 'none',
- :crossing => 'max',
- :visible => 0
+ num_format: 'General',
+ label_position: 'none',
+ crossing: 'max',
+ visible: 0
}
end
def y2_axis_defaults
{
- :num_format => 'General',
- :major_gridlines => { :visible => 0 },
- :position => 'right',
- :visible => 1
+ num_format: 'General',
+ major_gridlines: { visible: 0 },
+ position: 'right',
+ visible: 1
}
end
#
# Write the <c:chartSpace> element.
@@ -801,12 +801,12 @@
second_chart = @combined
@writer.tag_elements('c:plotArea') do
# Write the c:layout element.
write_layout(@plotarea.layout, 'plot')
# Write the subclass chart type elements for primary and secondary axes.
- write_chart_type(:primary_axes => 1)
- write_chart_type(:primary_axes => 0)
+ write_chart_type(primary_axes: 1)
+ write_chart_type(primary_axes: 0)
# Configure a combined chart if present.
if second_chart
# Secondary axis has unique id otherwise use same as primary.
@@ -821,19 +821,19 @@
# Share series index with primary chart.
second_chart.series_index = @series_index
# Write the subclass chart type elements for combined chart.
- second_chart.write_chart_type(:primary_axes => 1)
- second_chart.write_chart_type(:primary_axes => 0)
+ second_chart.write_chart_type(primary_axes: 1)
+ second_chart.write_chart_type(primary_axes: 0)
end
# Write the category and value elements for the primary axes.
params = {
- :x_axis => @x_axis,
- :y_axis => @y_axis,
- :axis_ids => @axis_ids
+ x_axis: @x_axis,
+ y_axis: @y_axis,
+ axis_ids: @axis_ids
}
if @date_category
write_date_axis(params)
else
@@ -842,23 +842,23 @@
write_val_axis(@x_axis, @y_axis, @axis_ids)
# Write the category and value elements for the secondary axes.
params = {
- :x_axis => @x2_axis,
- :y_axis => @y2_axis,
- :axis_ids => @axis2_ids
+ x_axis: @x2_axis,
+ y_axis: @y2_axis,
+ axis_ids: @axis2_ids
}
write_val_axis(@x2_axis, @y2_axis, @axis2_ids)
# Write the secondary axis for the secondary chart.
if second_chart && second_chart.is_secondary?
params = {
- :x_axis => second_chart.x2_axis,
- :y_axis => second_chart.y2_axis,
- :axis_ids => second_chart.axis2_ids
+ x_axis: second_chart.x2_axis,
+ y_axis: second_chart.y2_axis,
+ axis_ids: second_chart.axis2_ids
}
second_chart.write_val_axis(
second_chart.x2_axis,
second_chart.y2_axis,