Class: Axlsx::ScatterChart
- Includes:
- OptionsParser
- Defined in:
- lib/axlsx/drawing/scatter_chart.rb
Overview
The ScatterChart allows you to insert a scatter chart into your worksheet
Instance Attribute Summary collapse
-
#scatter_style ⇒ Object
(also: #scatterStyle)
The Style for the scatter chart must be one of :none | :line | :lineMarker | :marker | :smooth | :smoothMarker return [Symbol].
Attributes inherited from Chart
#bg_color, #display_blanks_as, #graphic_frame, #legend_position, #plot_visible_only, #rounded_corners, #series, #series_type, #show_legend, #style, #title, #vary_colors, #view_3D
Instance Method Summary collapse
-
#axes ⇒ Axes
The axes for the scatter chart.
-
#initialize(frame, options = {}) ⇒ ScatterChart
constructor
Creates a new scatter chart.
-
#to_xml_string(str = +'')) ⇒ String
Serializes the object.
-
#x_val_axis ⇒ ValAxis
(also: #xValAxis)
the x value axis.
-
#y_val_axis ⇒ ValAxis
(also: #yValAxis)
the y value axis.
Methods included from OptionsParser
Methods inherited from Chart
#add_series, #d_lbls, #end_at, #from, #index, #pn, #relationship, #start_at, #title_size=, #to
Constructor Details
#initialize(frame, options = {}) ⇒ ScatterChart
Creates a new scatter chart
32 33 34 35 36 37 38 39 40 |
# File 'lib/axlsx/drawing/scatter_chart.rb', line 32 def initialize(frame, = {}) @vary_colors = 0 @scatter_style = :lineMarker super(frame, ) @series_type = ScatterSeries @d_lbls = nil end |
Instance Attribute Details
#scatter_style ⇒ Object Also known as: scatterStyle
The Style for the scatter chart must be one of :none | :line | :lineMarker | :marker | :smooth | :smoothMarker return [Symbol]
14 15 16 |
# File 'lib/axlsx/drawing/scatter_chart.rb', line 14 def scatter_style @scatter_style end |
Instance Method Details
#axes ⇒ Axes
The axes for the scatter chart. ScatterChart has an x_val_axis and a y_val_axis
69 70 71 |
# File 'lib/axlsx/drawing/scatter_chart.rb', line 69 def axes @axes ||= Axes.new(x_val_axis: ValAxis, y_val_axis: ValAxis) end |
#to_xml_string(str = +'')) ⇒ String
Serializes the object
52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/axlsx/drawing/scatter_chart.rb', line 52 def to_xml_string(str = +'') super(str) do str << '<c:scatterChart>' str << '<c:scatterStyle val="' << scatter_style.to_s << '"/>' str << '<c:varyColors val="' << vary_colors.to_s << '"/>' @series.each { |ser| ser.to_xml_string(str) } d_lbls.to_xml_string(str) if @d_lbls axes.to_xml_string(str, ids: true) str << '</c:scatterChart>' axes.to_xml_string(str) end str end |
#x_val_axis ⇒ ValAxis Also known as: xValAxis
the x value axis
19 20 21 |
# File 'lib/axlsx/drawing/scatter_chart.rb', line 19 def x_val_axis axes[:x_val_axis] end |
#y_val_axis ⇒ ValAxis Also known as: yValAxis
the y value axis
26 27 28 |
# File 'lib/axlsx/drawing/scatter_chart.rb', line 26 def y_val_axis axes[:y_val_axis] end |