[Qgis-developer] QgsDiagramRendererV2 and QgsLinearlyInterpolatedDiagramRenderer properties access

Christophe Damour sigeal at sigeal.com
Sat Jan 3 02:32:08 PST 2015


Hi,

I am working on a QGis 2.6 python plugin in which I use diagram renderers :
dr = QgsLinearlyInterpolatedDiagramRenderer()
...
dr.setUpperValue(myUpperValue)
...
myLayer.setDiagramRenderer(dr)

This works well, and if my data change, I can update the renderer this way :
dr = myLayer.diagramRenderer()
dr.setUpperValue(myNewUpperValue)

Now here is my problem : If I modify myLayer properties from QGis user 
interface, I can't access its diagram properties anymore, because dr = 
myLayer.diagramRenderer() returns a QgsDiagramRendererV2 object instead 
of a QgsLinearlyInterpolatedDiagramRenderer one.
So when I try to set the new upper value, I get this error :
AttributeError: 'QgsDiagramRendererV2' object has no attribute 
'setUpperValue'

Can someone tell me what I am doing wrong ?

Any hint greatly appreciated. Thanks in advance,

-- 
Christophe DAMOUR



---
Ce courrier électronique ne contient aucun virus ou logiciel malveillant parce que la protection avast! Antivirus est active.
http://www.avast.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150103/8b314bc7/attachment.html>


More information about the Qgis-developer mailing list