Class: QgsTicksScaleBarRenderer

class qgis.core.QgsTicksScaleBarRenderer(position: QgsTicksScaleBarRenderer.TickPosition = QgsTicksScaleBarRenderer.TicksMiddle)

Bases: QgsScaleBarRenderer

Constructor for QgsTicksScaleBarRenderer.

QgsTicksScaleBarRenderer(QgsTicksScaleBarRenderer)

A scale bar that draws segments using short ticks.

New in version 3.0.

Parameters

position

class TickPosition

Bases: int

TicksDown = 1
TicksMiddle = 2
TicksUp = 0
clone(self)QgsTicksScaleBarRenderer
Return type

QgsTicksScaleBarRenderer

draw(self, context: QgsRenderContext, settings: QgsScaleBarSettings, scaleContext: QgsScaleBarRenderer.ScaleBarContext)
Parameters
drawDefaultLabels(self, context: QgsRenderContext, settings: QgsScaleBarSettings, scaleContext: QgsScaleBarRenderer.ScaleBarContext)

Draws default scalebar labels using the specified settings and scaleContext to a destination render context.

firstLabelString(self, settings: QgsScaleBarSettings) → str

Returns the text used for the first label in the scalebar.

firstLabelXOffset(self, settings: QgsScaleBarSettings) → float

Returns the x-offset (in millimeters) used for the first label in the scalebar.

Deprecated since version Use: the version with QgsRenderContext instead.

firstLabelXOffset(self, settings: QgsScaleBarSettings, context: QgsRenderContext, scaleContext: QgsScaleBarRenderer.ScaleBarContext) -> float Returns the x-offset (in render context painter units) used for the first label in the scalebar.

New in version 3.2.

flags(self)QgsScaleBarRenderer.Flags
Return type

QgsScaleBarRenderer.Flags

id(self) → str
Return type

str

segmentPositions(self, scaleContext: QgsScaleBarRenderer.ScaleBarContext, settings: QgsScaleBarSettings) → List[float]

Returns a list of positions for each segment within the scalebar.

Deprecated since version use: the version with a QgsRenderContext instead

segmentPositions(self, context: QgsRenderContext, scaleContext: QgsScaleBarRenderer.ScaleBarContext, settings: QgsScaleBarSettings) -> List[float] Returns a list of positions for each segment within the scalebar.

New in version 3.14.

segmentWidths(self, scaleContext: QgsScaleBarRenderer.ScaleBarContext, settings: QgsScaleBarSettings) → List[float]

Returns a list of widths of each segment of the scalebar.

setTickPosition(self, position: QgsTicksScaleBarRenderer.TickPosition)

Sets the position for tick marks in the scalebar.

See also

tickPosition()

Parameters

position (QgsTicksScaleBarRenderer.TickPosition) –

sortKey(self) → int
Return type

int

tickPosition(self)QgsTicksScaleBarRenderer.TickPosition

Returns the position for tick marks in the scalebar.

Return type

QgsTicksScaleBarRenderer.TickPosition

visibleName(self) → str
Return type

str