Class: Axlsx::BubbleChart
- Includes:
- OptionsParser
- Defined in:
- lib/axlsx/drawing/bubble_chart.rb
Overview
The BubbleChart allows you to insert a bubble chart into your worksheet
Instance Attribute Summary
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 bubble chart.
-
#initialize(frame, options = {}) ⇒ BubbleChart
constructor
Creates a new bubble 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 = {}) ⇒ BubbleChart
Creates a new bubble chart
26 27 28 29 30 31 32 33 |
# File 'lib/axlsx/drawing/bubble_chart.rb', line 26 def initialize(frame, = {}) @vary_colors = 0 super @series_type = BubbleSeries @d_lbls = nil end |
Instance Method Details
#axes ⇒ Axes
The axes for the bubble chart. BubbleChart has an x_val_axis and a y_val_axis
54 55 56 |
# File 'lib/axlsx/drawing/bubble_chart.rb', line 54 def axes @axes ||= Axes.new(x_val_axis: ValAxis, y_val_axis: ValAxis) end |
#to_xml_string(str = +'')) ⇒ String
Serializes the object
38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/axlsx/drawing/bubble_chart.rb', line 38 def to_xml_string(str = +'') super do str << '<c:bubbleChart>' 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:bubbleChart>' axes.to_xml_string(str) end str end |
#x_val_axis ⇒ ValAxis Also known as: xValAxis
the x value axis
13 14 15 |
# File 'lib/axlsx/drawing/bubble_chart.rb', line 13 def x_val_axis axes[:x_val_axis] end |
#y_val_axis ⇒ ValAxis Also known as: yValAxis
the y value axis
20 21 22 |
# File 'lib/axlsx/drawing/bubble_chart.rb', line 20 def y_val_axis axes[:y_val_axis] end |