Uwe Rathmann | 8 Oct 2009 07:52
Picon

Re: calling setPen for each symbol

On Thursday 08 October 2009 07:04, Paul Harris wrote:

> An example usage... X-Y chart with markers.  On the bottom axis, voltage.
> On the Y axis, current.  The colour corresponds to the time that the
> reading was taken.  Colour is a continuous spectrum from blue to red.

A 3D curve representing the 3rd dimension as color is on my TODO list for Qt 
5.3. ( Guess something about 1-2 hours of work ).

> Or, I might hack the basic datatype to add in a virtual color() call.  That
> wouldn't be too hard.

Use a QwtColorMap - it is made for mapping values to colors.

> Ideally I'll subclass qwt_plot_curve, but it may not be structured in the
> best way for subclassing (I'll have to figure that out later).

Consider to use a 5.3 snapshot (= trunk), where you find the QwtPlotSeriesItem 
template, what is exactly what you are looking for.

> The real question is, does changing the pen colour all the time affect
> performance?   

No, the real question is: how do you reduce the number of points you need to 
paint according to the current zoom level. 

Uwe

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference

Gmane