Node:Attributes, Next:, Previous:Anatomy, Up:Top



Attributes

The look of a component of a chart (see Anatomy) is defined by a collection of attributes. For example, an X or Y axis (see axis) includes an integer tic_len attribute that defines the length of "tick" lines drawn perpendicular to the axis. It also has an integer tic_interval attribute that defines the separation between tick lines. See axis, for the full list of Axis's attributes.

Attributes are usually specified by named arguments while creating a component:

ax = axis.X(tic_len = 3, tic_interval = 50)

Attributes can also be changed after a component is created, but before area.T:draw(), the main drawing procedure (see area), is called. The below example has the same effect as the above.

ax = axis.X()
ax.tic_len = 3
ax.tic_interval = 50

Each attribute has a default value that supposedly gives you a standard look to the chart. You can change the default values through chart_object module. For example, the below example has the same effect as the above, except that all X axes created in the future will have the new default values.

chart_object.set_defaults(axis.X, tic_len=3, tic_interval=50)
ax = axis.X()