Graphics elements are the way you have to draw images ad shapes on the band canvas.
They can be useful also to make customized borders in bands.
Path: geraldo.graphics.Graphic
This is the basic graphic class. You should use it only when inheriting to create your own graphic class, never use it directly.
Its rect area is based on left-width-top-height dimensions.
Attributes
name - Default: None
visible - Default: True
Set False if you want to make it not visible.
stroke - Default: True
stroke_color - Default: reportlab.lib.colors.black
stroke_width - Default: 1
fill - Default: False
fill_color - Default: reportlab.lib.colors.black
Rendering attributes
They are read-only attributes you can use in render time.
Methods
set_rect(**kwargs)
Used to generator set the hard rectangle when rendering pages. Override it to set your own rule if you need.
Path: geraldo.graphics.Fixed
In the same way of Graphic class, you should use this just to inhert and create your own graphic. This is a graphic with rect with left-right-top-bottom dimensioning.
Path: geraldo.Rect
A rectangle with square borders on the canvas.
Example of use
>>> Rect(left=1*cm, top=0.5*cm, width=10*cm, height=0.5*cm, fill=True, fill_color=yellow)
Attributes
Path: geraldo.RoundRect
A rectangle with rounded borders on the canvas.
Example of use
>>> RoundRect(left=1*cm, top=0.5*cm, width=10*cm, height=0.5*cm, stroke=True, stroke_width=3, stroke_color=blue)
Attributes
left - Required
width - Required
top - Required
height - Required
radius - Required
Inform the radius number for the round corners.
Path: geraldo.Line
Example of use
>>> Line(left=1*cm, top=0.5*cm, right=10*cm, bottom=0.5*cm)
Attributes
Path: geraldo.Circle
Example of use
>>> Circle(left_center=6*cm, top_center=3.5*cm, radius=3*cm)
Attributes
Path: geraldo.Arc
Example of use
>>> Arc(left=1*cm, top=0.5*cm, right=10*cm, bottom=0.5*cm, extent=50, start_angle=5)
Attributes
Path: geraldo.Ellipse
Example of use
>>> Ellipse(left=1*cm, top=0.5*cm, right=10*cm, bottom=0.5*cm)
Attributes
Path: geraldo.Image
Example of use
>>> Image(left=1*cm, top=0.5*cm, right=10*cm, bottom=0.5*cm, filename='path/to/file.jpg')
Attributes
left - Required
width - Required
top - Required
height - Required
filename - Required
You can inform a filename path or a Python Imaging Library Image instance. Then you have to have this library installed.
get_image - Default: None
You should inform a function or lambda object to this attribute when you want to work with Images or Charts based on object values or logic.