Logo Search packages:      
Sourcecode: ygraph version File versions  Download package

gint axis_calc_height ( Axis axis  ) 

Calculate the amount of space needed by an axis according to the text in its labels.

axis The axis to be measured.
The height (in pixels) of the axis.

Definition at line 344 of file axis.c.

References axis_get_text_height(), _Axis::font, _Axis::orientation, _Tick::str, and _Axis::ticks.

Referenced by axis_create().

  GArray* ticks;
  Tick *tick;
  gint height;
  gint nticks;
  gint i;

  ticks = axis->ticks;
  nticks = ticks->len;

  height = 0;
  for (i=0; i<nticks; ++i)
      tick = g_array_index(ticks, Tick*, i);
      height = MAX(height, axis_get_text_height(axis->font, tick->str, 
  return height;

Generated by  Doxygen 1.6.0   Back to index