3 Attributes
Description: Attributes
Keywords: pychart

#
3 Attributes

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

Attributes are usually specified by named arguments during component creation:

    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 Section 6), 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()