Class: Writexlsx::Chart::Column
- Inherits:
-
Writexlsx::Chart
- Object
- Writexlsx::Chart
- Writexlsx::Chart::Column
- Includes:
- Utility
- Defined in:
- lib/write_xlsx/chart/column.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::CHAR_WIDTHS, Utility::COL_MAX, Utility::PERL_TRUE_VALUES, Utility::ROW_MAX, Utility::SHEETNAME_MAX, Utility::STR_MAX
Instance Attribute Summary
Attributes inherited from Writexlsx::Chart
#already_inserted, #axis2_ids, #combined, #date_category, #embedded, #formula_data, #formula_ids, #height, #id, #index, #label_position_default, #label_positions, #name, #palette, #protection, #series_index, #width, #writer, #x2_axis, #x_offset, #x_scale, #y2_axis, #y_offset, #y_scale
Instance Method Summary collapse
-
#initialize(subtype) ⇒ Column
constructor
A new instance of Column.
-
#write_bar_dir ⇒ Object
Write the <c:barDir> element.
-
#write_chart_type(params) ⇒ Object
Override the virtual superclass method with a chart specific method.
-
#write_err_dir(direction) ⇒ Object
Write the <c:errDir> element.
Methods included from Utility
#absolute_char, #check_dimensions, #check_dimensions_and_update_max_min_values, #check_parameter, #color, #convert_date_time, #convert_font_args, #dash_types, delete_files, #escape_url, #fill_properties, #float_to_str, #get_font_latin_attributes, #get_font_style_attributes, #get_image_properties, #layout_properties, #legend_properties, #line_fill_properties, #line_properties, #palette_color, #params_to_font, #pattern_properties, #pixels_to_points, #process_bmp, #process_gif, #process_jpg, #process_png, #process_workbook_options, #ptrue?, #put_deprecate_message, #quote_sheetname, #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_a_body_pr, #write_a_def_rpr, #write_a_end_para_rpr, #write_a_lst_style, #write_a_p_formula, #write_a_p_pr_formula, #write_a_solid_fill, #write_a_srgb_clr, #write_anchor, #write_auto_fill, #write_color, #write_comment_path, #write_def_rpr_r_pr_common, #write_div, #write_fill, #write_font, #write_stroke, #write_tx_pr, #write_xml_declaration, #xl_cell_to_rowcol, #xl_col_to_name, #xl_range, #xl_range_formula, #xl_rowcol_to_cell, #xl_string_pixel_width, #xml_str
Methods inherited from Writexlsx::Chart
#add_series, #already_inserted?, #assemble_xml_file, #combine, #data_id, factory, #is_secondary?, #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, #show_na_as_empty_cell, #write_bar_chart, #write_val_axis
Methods included from Gradient
Constructor Details
#initialize(subtype) ⇒ Column
Returns a new instance of Column.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/write_xlsx/chart/column.rb', line 33 def initialize(subtype) super(subtype) @subtype = subtype || 'clustered' @horiz_val_axis = 0 # Override and reset the default axis values. @y_axis.defaults[:num_format] = '0%' if @subtype == 'percent_stacked' set_y_axis # Set the available data label positions for this chart type. @label_position_default = 'outside_end' @label_positions = { 'center' => 'ctr', 'inside_base' => 'inBase', 'inside_end' => 'inEnd', 'outside_end' => 'outEnd' } end |
Instance Method Details
#write_bar_dir ⇒ Object
Write the <c:barDir> element.
64 65 66 |
# File 'lib/write_xlsx/chart/column.rb', line 64 def @writer.empty_tag('c:barDir', [%w[val col]]) end |
#write_chart_type(params) ⇒ Object
Override the virtual superclass method with a chart specific method.
56 57 58 59 |
# File 'lib/write_xlsx/chart/column.rb', line 56 def write_chart_type(params) # Write the c:barChart element. (params) end |
#write_err_dir(direction) ⇒ Object
Write the <c:errDir> element. Overridden from Chart class since it is not used in Bar charts.
72 73 74 |
# File 'lib/write_xlsx/chart/column.rb', line 72 def write_err_dir(direction) # do nothing end |