Legend module

class lys.widgets.canvas.interface.Legend.CanvasLegend(canvas)[source]

Bases: CanvasPart

Abstract base class for Legend. All methods in this interface can be accessed from CanvasBase instance.

getLegendFont()[source]

Get the font of the legend.

Returns:

The information of font. See setLegendFont()

Return type:

dict

getLegendFrameVisible()[source]

Get the visibility of the frame

Returns:

The visibility of the frame.

Return type:

bool

getLegendPosition()[source]

Get the font of the legend.

Returns:

The position of the legend.

Return type:

tuple

legendPositionChanged

Emitted when the position of the legend is changed.

setLegendFont(fname, size=10, color='black')[source]

Set the font of the legend.

Parameters:
  • fname (str) – The name of the font.

  • size (int) – The size of the font.

  • color (str) – The color of the font such as #111111.

setLegendFrameVisible(visible)[source]

Show/hide the frame of the legend.

Parameters:

visible (bool) – The visibility of the frame

setLegendPosition(position)[source]

Set the position of the legend.

Parameters:

position (tuple) – The position of the legend in the form of (x,y)