setting color of the text in qwtdial partially
i can able to set the color of the text in qwt dial.
but i need to set the color of the text partially.
Example:
if lowerbound is 0 and upperbound is 100
i need the text color for 0 to 40 to be one color(say green)
and text color for 40 to 100 to be another color(say blue)
Re: setting color of the text in qwtdial partially
Overload QwtRoundScaleDraw::label() and assign your derived class using QwtDial::setScaleDraw().
By using QwtText::setColor() you can set individual color for a label.
Uwe
Re: setting color of the text in qwtdial partially
Quote:
Originally Posted by
Uwe
Overload QwtRoundScaleDraw::label() and assign your derived class using QwtDial::setScaleDraw().
By using QwtText::setColor() you can set individual color for a label.
Uwe
Thanks Uwe
i need the color of dial also as two different colors
like first half part of the dial as one color and remaining half of the dial as another color
Re: setting color of the text in qwtdial partially
Which parts of the dial - do you have a screenshot ?
Uwe
1 Attachment(s)
Re: setting color of the text in qwtdial partially
Attachment 11225
i have attached the image
Re: setting color of the text in qwtdial partially
Again you can do it by overloading methods from QwtRoundScaleDraw - here drawBackbone(). You could use a gradient or draw the arc in segments with different pens.
Have a look at the default implementations of QwtRoundScaleDraw, then it should be straightforward how to do it.
Uwe
Re: setting color of the text in qwtdial partially
Quote:
Originally Posted by
Uwe
Again you can do it by overloading methods from QwtRoundScaleDraw - here drawBackbone(). You could use a gradient or draw the arc in segments with different pens.
Have a look at the default implementations of QwtRoundScaleDraw, then it should be straightforward how to do it.
Uwe
I referred QwtRoundScaleDraw .but i couldn't understand..
please can you give me example for drawBackbone in QwtRoundScaleDraw
Re: setting color of the text in qwtdial partially
Qwt is open source - there is no better example than simply looking at the code.
Uwe