Class: QgsColorRampLegendNodeSettings¶
- class qgis.core.QgsColorRampLegendNodeSettings¶
Bases:
sip.wrapper
Settings for a color ramp legend node.
New in version 3.18.
QgsColorRampLegendNodeSettings()
QgsColorRampLegendNodeSettings(other:
QgsColorRampLegendNodeSettings
) Copy constructorMethods
Returns the direction of the ramp.
Returns the label for the maximum value on the ramp.
Returns the label for the minimum value on the ramp.
Returns the numeric format used for numbers in the scalebar.
Returns the ramp orientation (i.e.
Returns the prefix to show before legend text.
Reads settings from an XML
element
.Sets the
direction
of the ramp.Sets the
label
for the maximum value on the ramp.Sets the
label
for the minimum value on the ramp.Sets the numeric
format
used for numbers in the scalebar.Sets the ramp
orientation
(i.e.Sets the
prefix
to show before legend text.Sets the
suffix
to show after legend text.Sets the text
format
used to render text in the legend item.Sets the flag to use a continuos gradient legend to
useContinuousLegend
.Returns the suffix to show after legend text.
Returns the text format used to render text in the legend item.
Returns
True
if a continuous gradient legend will be used.Writes settings to an XML
element
.Attributes
- class Direction¶
Bases:
int
- MaximumToMinimum = 1¶
- MinimumToMaximum = 0¶
- direction(self) QgsColorRampLegendNodeSettings.Direction ¶
Returns the direction of the ramp.
See also
See also
- Return type
- maximumLabel(self) str ¶
Returns the label for the maximum value on the ramp.
If the returned string is empty than a default value will be generated based on the associated maximum value.
See also
See also
- Return type
str
- minimumLabel(self) str ¶
Returns the label for the minimum value on the ramp.
If the returned string is empty than a default value will be generated based on the associated minimum value.
See also
See also
- Return type
str
- numericFormat(self) QgsNumericFormat ¶
Returns the numeric format used for numbers in the scalebar.
See also
New in version 3.12.
- Return type
- orientation(self) Qt.Orientation ¶
Returns the ramp orientation (i.e. horizontal or vertical).
See also
See also
- Return type
Qt.Orientation
- prefix(self) str ¶
Returns the prefix to show before legend text.
See also
See also
- Return type
str
- readXml(self, element: QDomElement, context: QgsReadWriteContext)¶
Reads settings from an XML
element
.- Parameters
element (QDomElement) –
context (QgsReadWriteContext) –
- setDirection(self, direction: QgsColorRampLegendNodeSettings.Direction)¶
Sets the
direction
of the ramp.See also
See also
- Parameters
direction (QgsColorRampLegendNodeSettings.Direction) –
- setMaximumLabel(self, label: str)¶
Sets the
label
for the maximum value on the ramp.If the
label
is empty than a default value will be generated based on the associated maximum value.See also
See also
- Parameters
label (str) –
- setMinimumLabel(self, label: str)¶
Sets the
label
for the minimum value on the ramp.If the
label
is empty than a default value will be generated based on the associated minimum value.See also
See also
- Parameters
label (str) –
- setNumericFormat(self, format: QgsNumericFormat)¶
Sets the numeric
format
used for numbers in the scalebar.Ownership of
format
is transferred to the scalebar.See also
New in version 3.12.
- Parameters
format (QgsNumericFormat) –
- setOrientation(self, orientation: Qt.Orientation)¶
Sets the ramp
orientation
(i.e. horizontal or vertical).See also
See also
- Parameters
orientation (Qt.Orientation) –
- setPrefix(self, prefix: str)¶
Sets the
prefix
to show before legend text.See also
See also
- Parameters
prefix (str) –
- setSuffix(self, suffix: str)¶
Sets the
suffix
to show after legend text.See also
See also
- Parameters
suffix (str) –
- setTextFormat(self, format: QgsTextFormat)¶
Sets the text
format
used to render text in the legend item.See also
- Parameters
format (QgsTextFormat) –
- setUseContinuousLegend(self, useContinuousLegend: bool)¶
Sets the flag to use a continuos gradient legend to
useContinuousLegend
.When this flag is set the legend will be rendered using a continuous color ramp with min and max values, when it is not set the legend will be rendered using separate items for each entry.
See also
See also
- Parameters
useContinuousLegend (bool) –
- suffix(self) str ¶
Returns the suffix to show after legend text.
See also
See also
- Return type
str
- textFormat(self) QgsTextFormat ¶
Returns the text format used to render text in the legend item.
See also
- Return type
- useContinuousLegend(self) bool ¶
Returns
True
if a continuous gradient legend will be used.See also
- Return type
bool
- writeXml(self, doc: QDomDocument, element: QDomElement, context: QgsReadWriteContext)¶
Writes settings to an XML
element
.- Parameters
doc (QDomDocument) –
element (QDomElement) –
context (QgsReadWriteContext) –