Attributes of GD::Graph Objects
GD::Graph has several attributes that you can set to control the
layout, color, and labels on your graph. Some of these attributes are
applicable only to certain types of graphs; for example, the pie_height attribute should be set only for
graphs of type GD::Graph::pie. These attributes are relegated to their
own sections later in this chapter. The following section describes
the attributes shared by all graphs.
Attributes of All Graphs
b_margin=>integert_margin=>integerl_margin=>integerr_margin=>integerThese attributes allow you to set the bottom, top, left, and right margins, respectively. The margin is defined as the blank space between the bounding box of the graph and the edge of the PNG graphic. The default margins are 0 pixels.
width=>integerheight=>integerThe dimensions of the final image, including margins.
transparent=>booleanIf the
transparentattribute is set to true, the background color (set with thebgclrattribute) is marked as transparent. The default value is true.interlaced=>booleanThe
interlacedattribute allows you to indicate whether the graph is stored as an interlaced PNG. The default value is true.bgclr=>colornamefgclr=>colornameboxcolor=>colornametextclr=>colornamelabelclr=>colornameaxislabelclr=>colornamelegendclr=>colornamevaluesclr=>colornameaccentclr=>colornameshadowclr=>colornameThese attributes set the colors of the various aspects of the graph: the background, foreground, graph box, text, label, axis label, legend, value ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access