PyChart Reference Manual

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

## Attributes

The look and feel of a component of a chart (see Anatomy) are defined by a collection of attributes. For example, 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. (For the full list of Axis's attributes, See axis.)

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.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()