Class: XlsxWriter::Workbook::Chart::Axis
- Inherits:
-
Object
- Object
- XlsxWriter::Workbook::Chart::Axis
- Defined in:
- ext/xlsxwriter/chart.c
Instance Method Summary collapse
-
#initialize(chart, type) ⇒ Object
constructor
:nodoc:.
- #interval_tick= ⇒ Object
- #interval_unit= ⇒ Object
- #label_align= ⇒ Object
- #label_position= ⇒ Object
- #log_base= ⇒ Object
- #major_tick_mark= ⇒ Object
- #major_unit= ⇒ Object
-
#max= ⇒ Object
call-seq: axis.max=(value) -> value.
-
#min= ⇒ Object
call-seq: axis.min=(value) -> value.
- #minor_tick_mark= ⇒ Object
- #minor_unit= ⇒ Object
-
#name= ⇒ Object
call-seq: axis.name=(name) -> name.
- #num_format= ⇒ Object
- #position= ⇒ Object
- #reverse= ⇒ Object
-
#set_fill(options) ⇒ Object
Sets axis fill options.
-
#set_line(options) ⇒ Object
Sets axis line options.
-
#set_name_font(options) ⇒ self
Same as Chart#set_font, but for axis name.
- #set_name_range ⇒ Object
-
#set_num_font(options) ⇒ self
Same as Chart#set_font, but for axis numbers.
- #source_linked=(val) ⇒ Object
Constructor Details
#initialize(chart, type) ⇒ Object
:nodoc:
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'ext/xlsxwriter/chart.c', line 107
VALUE
chart_axis_init(VALUE self, VALUE chart, VALUE type) {
struct chart_axis *ptr;
struct chart *c_ptr;
TypedData_Get_Struct(chart, struct chart, &chart_type, c_ptr);
TypedData_Get_Struct(self, struct chart_axis, &chart_axis_type, ptr);
rb_iv_set(self, "@chart", chart);
if (c_ptr && c_ptr->chart) {
ID axis = rb_check_id_cstr("x", 1, NULL);
if (axis && axis == rb_check_id(&type)) {
ptr->chart_axis = c_ptr->chart->x_axis;
return self;
}
axis = rb_check_id_cstr("y", 1, NULL);
if (axis && axis == rb_check_id(&type)) {
ptr->chart_axis = c_ptr->chart->y_axis;
return self;
}
rb_raise(rb_eArgError, "Unexpected axis type %"PRIsVALUE, rb_inspect(type));
} else {
rb_raise(rb_eRuntimeError, "Chart seems to be already closed.");
}
return self;
}
|
Instance Method Details
#interval_tick= ⇒ Object
#interval_unit= ⇒ Object
#label_align= ⇒ Object
#label_position= ⇒ Object
#log_base= ⇒ Object
#major_tick_mark= ⇒ Object
#major_unit= ⇒ Object
#max= ⇒ Object
call-seq: axis.max=(value) -> value
Sets the chart axis max
value.
#min= ⇒ Object
call-seq: axis.min=(value) -> value
Sets the chart axis min
value.
#minor_tick_mark= ⇒ Object
#minor_unit= ⇒ Object
#name= ⇒ Object
call-seq: axis.name=(name) -> name
Sets the chart axis +name+.
#num_format= ⇒ Object
#position= ⇒ Object
#reverse= ⇒ Object
#set_fill(options) ⇒ Object
Sets axis fill options. See libxlsxwriter doc for details.
477 478 479 480 481 482 |
# File 'ext/xlsxwriter/chart.c', line 477
VALUE
chart_axis_set_fill_(VALUE self, VALUE opts) {
lxw_chart_fill fill = val_to_lxw_chart_fill(opts);
LXW_NO_RESULT_CALL(chart_axis, set_fill, &fill);
return self;
}
|
#set_line(options) ⇒ Object
Sets axis line options. See libxlsxwriter doc for details.
466 467 468 469 470 471 |
# File 'ext/xlsxwriter/chart.c', line 466
VALUE
chart_axis_set_line_(VALUE self, VALUE opts) {
lxw_chart_line line = val_to_lxw_chart_line(opts);
LXW_NO_RESULT_CALL(chart_axis, set_line, &line);
return self;
}
|
#set_name_font(options) ⇒ self
Same as Chart#set_font, but for axis name.
444 445 446 447 448 449 |
# File 'ext/xlsxwriter/chart.c', line 444
VALUE
chart_axis_set_name_font_(VALUE self, VALUE value) {
lxw_chart_font font = val_to_lxw_chart_font(value);
LXW_NO_RESULT_CALL(chart_axis, set_name_font, &font);
return self;
}
|
#set_name_range ⇒ Object
#set_num_font(options) ⇒ self
Same as Chart#set_font, but for axis numbers.
455 456 457 458 459 460 |
# File 'ext/xlsxwriter/chart.c', line 455
VALUE
chart_axis_set_num_font_(VALUE self, VALUE value) {
lxw_chart_font font = val_to_lxw_chart_font(value);
LXW_NO_RESULT_CALL(chart_axis, set_num_font, &font);
return self;
}
|
#source_linked=(val) ⇒ Object
501 502 503 504 505 506 507 508 509 510 |
# File 'ext/xlsxwriter/chart.c', line 501
VALUE
chart_axis_set_source_linked_(VALUE self, VALUE val) {
struct chart_axis *ptr;
TypedData_Get_Struct(self, struct chart_axis, &chart_axis_type, ptr);
ptr->chart_axis->source_linked = NUM2UINT(rb_check_to_int(val));
return val;
}
|