What is the bug or the crash?
The above graduated renderers do not create any classes when all of the values are the same.
This means that if the layer has all the same value for a field nothing will display, and the layer will appear empty.
The other graduated renderers will propose at least one class.
Steps to reproduce the issue
- Create a layer with zero values (could be other value)
l = QgsVectorLayer("LineString?field=test:double", "test layer", "memory")
f1=QgsFeature()
f1.setAttributes([0.0])
f2=QgsFeature()
f2.setAttributes([0.0])
with edit(l):
l.addFeature(f1)
l.addFeature(f2)
QgsProject().instance().addMapLayer(l)
- Open layer stying panel
- Select graduated renderer
- Set the value to be the 'test' column
- Test by selecting different render modes and pressing 'classify'
Versions
| Version de QGIS | 3.44.3-Solothurn |
| Révision du code | 1d1d67e9edd |
| |
| Libraries |
| Version de Qt | 5.15.13 |
| Version de Python | 3.12.11 |
| GDAL version | 3.11.3 — Eganville |
| Version de Proj | 9.6.2 |
| Version de la base de données du registre EPSG | v12.013 (2025-05-26) |
| Version de GEOS | 3.13.1-CAPI-1.19.2 |
| Version de SQLite | 3.50.4 |
| Version de PDAL | 2.9.0 |
| Version du client PostgreSQL | 17.3 |
| Version de SpatiaLite | 5.1.0 |
| Version de QWT | 6.3.0 |
| Version de QScintilla2 | 2.14.1 |
| Version de l'OS | Windows 11 Version 2009 |
| |
| Extensions Python actives |
| db_manager | 0.1.20 |
| grassprovider | 2.12.99 |
| MetaSearch | 0.3.6 |
| processing | 2.12.99 |
Supported QGIS version
New profile
Additional context
No response
What is the bug or the crash?
The above graduated renderers do not create any classes when all of the values are the same.
This means that if the layer has all the same value for a field nothing will display, and the layer will appear empty.
The other graduated renderers will propose at least one class.
Steps to reproduce the issue
Versions
Supported QGIS version
New profile
Additional context
No response