Re: Gantt serie with different colors
- From: "Bjørge" <bjorge@xxxxxxxxxxxxxxx>
- Date: Wed, 31 Aug 2005 11:03:48 +0200
aleicaro@xxxxxxxxx wrote:
> Hi,
> I've the following problem.
> I have to build a Gantt chart. On X axis I've obviously the time. On Y
> axis I've some resources (employees). The chart will represent when
> each employee is busy. I would like to have a different colour
> (assigned from code) for each employee, and I would like to have, for
> each employee a different colour for the sundays (I know when is
> sunday but how can I assign a different color for a piece of "bar").
>
> Is it possible, and how can I do it?
Having created such a beast a few years ago, I have 2 hints for you:
1. Rectangles are painted separately. That is, no different colours in same
operation. Also, if tou want to draw a line around the entire (composite)
rectangle, this needs another painting operation.
2. Do create an "offscreen" bitmap to do your drawing - and then copy the
repaint region from this onto the visible control's canvas in one operation.
Reason: Offscreen drawing/painting is much faster, and by reducing visual
update to one single one you avoid delays and flickering. bear in mind that
by using an offscreen bitmap the graphic is never erased, only repainted.
Avoids flicker.
--
Regards,
Bjørge Sæther
bjorge@xxxxxxxxxxxx
.
- Prev by Date: Re: Internet Cafe Terminal Help
- Next by Date: Re: Is delphi a good introduction to programming?
- Previous by thread: Re: Help for use a DLL
- Next by thread: Re: Is delphi a good introduction to programming?
- Index(es):
Relevant Pages
|