Class: Writexlsx::Chart::Radar
- Inherits:
-
Writexlsx::Chart
- Object
- Writexlsx::Chart
- Writexlsx::Chart::Radar
- Includes:
- Utility
- Defined in:
- lib/write_xlsx/chart/radar.rb
Overview
The Column chart module also supports the following sub-types:
stacked
percent_stacked
These can be specified at creation time via the add_chart() Worksheet method:
chart = workbook.add_chart( :type => 'column', :subtype => 'stacked' )
Constant Summary
Constants included from Utility
Utility::COL_MAX, Utility::ROW_MAX, Utility::SHEETNAME_MAX, Utility::STR_MAX
Instance Attribute Summary
Attributes inherited from Writexlsx::Chart
#embedded, #formula_data, #formula_ids, #height, #id, #index, #name, #palette, #protection, #width, #x_offset, #x_scale, #y_offset, #y_scale
Instance Method Summary collapse
-
#initialize(subtype) ⇒ Radar
constructor
A new instance of Radar.
-
#write_chart_type(params) ⇒ Object
Override the virtual superclass method with a chart specific method.
-
#write_radar_chart(params) ⇒ Object
Write the <c:radarChart> element.
-
#write_radar_style ⇒ Object
Write the <c:radarStyle> element.
Methods included from Utility
#absolute_char, #check_dimensions, #check_dimensions_and_update_max_min_values, #check_parameter, #convert_date_time, #dash_types, delete_files, #fill_properties, #float_to_str, #layout_properties, #line_fill_properties, #line_properties, #palette_color, #pixels_to_points, #ptrue?, #put_deprecate_message, #r_id_attributes, #row_col_notation, #shape_style_base, #store_col_max_min_values, #store_row_max_min_values, #substitute_cellref, #underline_attributes, #v_shape_attributes_base, #v_shape_style_base, #value_or_raise, #write_anchor, #write_auto_fill, #write_color, #write_comment_path, #write_div, #write_fill, #write_font, #write_stroke, #write_xml_declaration, #xl_cell_to_rowcol, #xl_col_to_name, #xl_range, #xl_range_formula, #xl_rowcol_to_cell, #xml_str
Methods inherited from Writexlsx::Chart
#add_series, #assemble_xml_file, #convert_font_args, #data_id, factory, #params_to_font, #process_names, #set_chartarea, #set_drop_lines, #set_embedded_config_data, #set_high_low_lines, #set_legend, #set_plotarea, #set_size, #set_style, #set_table, #set_title, #set_up_down_bars, #set_x2_axis, #set_x_axis, #set_xml_writer, #set_y2_axis, #set_y_axis, #show_blanks_as, #show_hidden_data, #write_bar_chart
Constructor Details
#initialize(subtype) ⇒ Radar
Returns a new instance of Radar.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/write_xlsx/chart/radar.rb', line 31 def initialize(subtype) super(subtype) @subtype = subtype || 'marker' if @subtype == 'marker' @default_marker = Marker.new(:type => 'none') end # Override and reset the default axis values. @x_axis.defaults[:major_gridlines] = { :visible => 1 } set_x_axis # Hardcode major_tick_mark for now untill there is an accessor. @y_axis.major_tick_mark = 'cross' end |
Instance Method Details
#write_chart_type(params) ⇒ Object
Override the virtual superclass method with a chart specific method.
49 50 51 52 |
# File 'lib/write_xlsx/chart/radar.rb', line 49 def write_chart_type(params) # Write the c:radarChart element. write_radar_chart(params) end |
#write_radar_chart(params) ⇒ Object
Write the <c:radarChart> element.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/write_xlsx/chart/radar.rb', line 57 def write_radar_chart(params) if ptrue?(params[:primary_axes]) series = get_primary_axes_series else series = get_secondary_axes_series end return if series.empty? @writer.tag_elements('c:radarChart') do # Write the c:radarStyle element. write_radar_style # Write the series elements. series.each { |s| write_series(s) } # Write the c:axId elements write_axis_ids(params) end end |
#write_radar_style ⇒ Object
Write the <c:radarStyle> element.
81 82 83 84 85 86 87 88 |
# File 'lib/write_xlsx/chart/radar.rb', line 81 def write_radar_style val = 'marker' val = 'filled' if @subtype == 'filled' attributes = [ ['val', val] ] @writer.empty_tag('c:radarStyle', attributes) end |