Class: QgsColorRampLegendNodeSettings¶
Settings for a color ramp legend node.
Added in version 3.18.
Methods
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. horizontal or vertical). |
|
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. horizontal or vertical). |
|
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 continuous 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 |
|
Writes settings to an XML element. |
Attributes
- class qgis.core.QgsColorRampLegendNodeSettings[source]¶
Bases:
object
- class Direction¶
Bases:
int
- MaximumToMinimum = 1¶
- MinimumToMaximum = 0¶
- direction(self) QgsColorRampLegendNodeSettings.Direction [source]¶
Returns the direction of the ramp.
See also
See also
- Return type:
- maximumLabel(self) str [source]¶
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 [source]¶
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 | None [source]¶
Returns the numeric format used for numbers in the scalebar.
See also
Added in version 3.12.
- Return type:
Optional[QgsNumericFormat]
- orientation(self) Qt.Orientation [source]¶
Returns the ramp orientation (i.e. horizontal or vertical).
See also
See also
- Return type:
Qt.Orientation
- prefix(self) str [source]¶
Returns the prefix to show before legend text.
See also
See also
- Return type:
str
- readXml(self, element: QDomElement, context: QgsReadWriteContext)[source]¶
Reads settings from an XML
element
.- Parameters:
element (QDomElement)
context (QgsReadWriteContext)
- setDirection(self, direction: QgsColorRampLegendNodeSettings.Direction)[source]¶
Sets the
direction
of the ramp.See also
See also
- Parameters:
direction (QgsColorRampLegendNodeSettings.Direction)
- setMaximumLabel(self, label: str | None)[source]¶
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 (Optional[str])
- setMinimumLabel(self, label: str | None)[source]¶
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 (Optional[str])
- setNumericFormat(self, format: QgsNumericFormat | None)[source]¶
Sets the numeric
format
used for numbers in the scalebar.Ownership of
format
is transferred to the scalebar.See also
Added in version 3.12.
- Parameters:
format (Optional[QgsNumericFormat])
- setOrientation(self, orientation: Qt.Orientation)[source]¶
Sets the ramp
orientation
(i.e. horizontal or vertical).See also
See also
- Parameters:
orientation (Qt.Orientation)
- setPrefix(self, prefix: str | None)[source]¶
Sets the
prefix
to show before legend text.See also
See also
- Parameters:
prefix (Optional[str])
- setSuffix(self, suffix: str | None)[source]¶
Sets the
suffix
to show after legend text.See also
See also
- Parameters:
suffix (Optional[str])
- setTextFormat(self, format: QgsTextFormat)[source]¶
Sets the text
format
used to render text in the legend item.See also
- Parameters:
format (QgsTextFormat)
- setUseContinuousLegend(self, useContinuousLegend: bool)[source]¶
Sets the flag to use a continuous 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 [source]¶
Returns the suffix to show after legend text.
See also
See also
- Return type:
str
- textFormat(self) QgsTextFormat [source]¶
Returns the text format used to render text in the legend item.
See also
- Return type:
- useContinuousLegend(self) bool [source]¶
Returns
True
if a continuous gradient legend will be used.See also
- Return type:
bool
- writeXml(self, doc: QDomDocument, element: QDomElement, context: QgsReadWriteContext)[source]¶
Writes settings to an XML
element
.- Parameters:
doc (QDomDocument)
element (QDomElement)
context (QgsReadWriteContext)