I´m trying to apply one of predefined color ramps to a categorized field in a vector layer.To do this, I'm using the code below suggested by Irssvt in another post.However, I cant´t see the result in map canvas unless I manually use the "Classify" button on the layer properties dialog.Is there something missing in my code? Is there a way do programmatically make the classify action?
myStyle = QgsStyleV2().defaultStyle() defaultColorRampNames = myStyle.colorRampNames() ramp = myStyle.colorRamp(defaultColorRampNames[4]) renderer = QgsCategorizedSymbolRendererV2("SETOR", []) renderer.setSourceColorRamp(ramp) sslyr.setRendererV2(renderer) # Publica e d
أكثر...
myStyle = QgsStyleV2().defaultStyle() defaultColorRampNames = myStyle.colorRampNames() ramp = myStyle.colorRamp(defaultColorRampNames[4]) renderer = QgsCategorizedSymbolRendererV2("SETOR", []) renderer.setSourceColorRamp(ramp) sslyr.setRendererV2(renderer) # Publica e d
أكثر...