Hi,

The code for the valueChanged event in InfLineLabel 
(http://www.pyqtgraph.org/documentation/_modules/pyqtgraph/graphicsItems/InfiniteLine.html#InfiniteLine)
 
uses the setText method inherited from TextItem 
(http://www.pyqtgraph.org/documentation/graphicsItems/textitem.html#pyqtgraph.TextItem.setText).
 
I see two possible options.
1. If you just want to set the size and colour of the label, then try using 
the setFont and setColor methods, something like 
OrderLine.label.setFont(....) and OrderLine.label.setColor(...), but you'll 
need to look up the PyQt documents for usage, as these wrap the underlying 
Qt methods.
2. Do a dirty hack on the code, and change the setText to setHtml in the 
valueChanged method of InfLineLabel. Not ideal, but might work.

Patrick

On Friday, 1 February 2019 03:37:34 UTC+10:30, Szilard Perenyi wrote:
>
> Basically something like this, but this doesnt work.
> OrderLine = pg.InfiniteLine(pos=price, movable=True, angle=0, pen=pen, 
> label=("<span style='font-size: 10pt;color:#b3ffb3'>%s</span>" % 
> (Quantity)) , labelOpts={'position': .890, 'anchors': [0,0], 'fill': bg, 
> 'movable': True} )
>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/0445d8b2-fdb5-44fe-9fb4-8cef03610085%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to