[Qgis-developer] Diagram transparency

Christophe Damour sigeal at sigeal.com
Tue Jan 6 10:25:55 PST 2015


Hi,

Thank to  Matthias Kuhn's comment on QGis issues list :
http://hub.qgis.org/issues/11957
Here is the answser to my question :
Transparency has to be set as alpha values for every color in 
QgsDiagramSettings.
The transparency variable has to be set accordingly in order to preserve 
the integrity of the layer properties dialog.

Hope this can help someone,

-- 
Christophe DAMOUR


Le 03/01/2015 15:21, Christophe Damour a écrit :
> Hi,
>
> I can't manage to make diagrams layers transparent using python.
> Here is what I do :
>
> dr = QgsLinearlyInterpolatedDiagramRenderer()
> ds = QgsDiagramSettings()
> ...
> ds.transparency = 70
> ...
> dr.setDiagramSettings(ds)
> ...
> myLayer.setDiagramRenderer(dr)
>
> The strange thing is that if I open the layer properties dialog, 
> transparency is correctly set in the diagram's appearence tab.
> Moreover, if I validate the dialog, the diagrams become transparent...
>
> Is this a bug or am I doing something wrong ?
>
> Thanks for any help,
>


---
Ce courrier électronique ne contient aucun virus ou logiciel malveillant parce que la protection avast! Antivirus est active.
http://www.avast.com



More information about the Qgis-developer mailing list