Class: XlsxWriter::Workbook::Chart::Axis

Inherits:
Object
  • Object
show all
Defined in:
ext/xlsxwriter/chart.c

Instance Method Summary collapse

Constructor Details

#initialize(chart, type) ⇒ Object

:nodoc:



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'ext/xlsxwriter/chart.c', line 61

VALUE
chart_axis_init(VALUE self, VALUE chart, VALUE type) {
  struct chart_axis *ptr;
  struct chart *c_ptr;

  Data_Get_Struct(chart, struct chart, c_ptr);
  Data_Get_Struct(self, struct chart_axis, 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.



431
432
433
434
435
436
# File 'ext/xlsxwriter/chart.c', line 431

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.



420
421
422
423
424
425
# File 'ext/xlsxwriter/chart.c', line 420

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.

Returns:

  • (self)


398
399
400
401
402
403
# File 'ext/xlsxwriter/chart.c', line 398

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_rangeObject

#set_num_font(options) ⇒ self

Same as Chart#set_font, but for axis numbers.

Returns:

  • (self)


409
410
411
412
413
414
# File 'ext/xlsxwriter/chart.c', line 409

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



455
456
457
458
459
460
461
462
463
464
# File 'ext/xlsxwriter/chart.c', line 455

VALUE
chart_axis_set_source_linked_(VALUE self, VALUE val) {
  struct chart_axis *ptr;

  Data_Get_Struct(self, struct chart_axis, ptr);

  ptr->chart_axis->source_linked = NUM2UINT(rb_check_to_int(val));

  return val;
}