Jump to content
Software FX Community

Controlling colors on Gantt charts?


User (Legacy)

Recommended Posts

How do I control the colors on Gantt charts? Especially to control the color

for "segments"?

I have many projects (let's say 10 for now) and each project has the same 4

phases to them.

Desired result: Phase 1 is Yellow, Phase 2 Green, etc. for all projects.

In the Gantt examples it refers to series and segments. Here series =

projects and segments = phases.

If I do the following:

objChart.OpenDataEx COD_COLORS,intProjectCount, 0

objChart.Series(0).Color = RGB(255, 255, 0) ' Yellow

objChart.CloseData COD_COLORS

it results in the first segment (phase) being yellow for ALL projects

(series).

However, if I try it for other phases, such as below

objChart.OpenDataEx COD_COLORS,intProjectCount, 0

objChart.Series(0).Color = RGB(255, 255, 0) ' Yellow

objChart.Series(1).Color = RGB(0, 255, 0) ' Green

objChart.CloseData COD_COLORS

I get an error message - "Unknown runtime error"

Thanks,

Karl

post-2107-13922392311124_thumb.jpg

Link to comment
Share on other sites

I tried using the:

objChart.MultipleColors = True

Approach.

The results are that I get a "shift" in the colors that matches the number

of "phases".

That is, if I use 4 phases, then 25% have color 1 as the first phase, then

it shifts to the second 25% have color 2, the third 25% have color 3 and the

last 25% have color 4 as the color of the first phase.

What am I missing when taking this approach to getting the phases color

coded?

Thanks,

Karl

"Karl" <karl@lgc.com> wrote in message

news:R7O0pFCYBHA.1472@webserver1.softwarefx.com...

> How do I control the colors on Gantt charts? Especially to control the

color

> for "segments"?

> I have many projects (let's say 10 for now) and each project has the same

4

> phases to them.

> Desired result: Phase 1 is Yellow, Phase 2 Green, etc. for all projects.

> In the Gantt examples it refers to series and segments. Here series =

> projects and segments = phases.

>

> If I do the following:

> objChart.OpenDataEx COD_COLORS,intProjectCount, 0

> objChart.Series(0).Color = RGB(255, 255, 0) ' Yellow

> objChart.CloseData COD_COLORS

> it results in the first segment (phase) being yellow for ALL projects

> (series).

>

> However, if I try it for other phases, such as below

> objChart.OpenDataEx COD_COLORS,intProjectCount, 0

> objChart.Series(0).Color = RGB(255, 255, 0) ' Yellow

> objChart.Series(1).Color = RGB(0, 255, 0) ' Green

> objChart.CloseData COD_COLORS

> I get an error message - "Unknown runtime error"

>

> Thanks,

> Karl

>

>

Link to comment
Share on other sites

Karl,

If you have X# of data points on a graph and want to use MultipleColors, you

need to do your OpenDataEx with that number of colors (X#). You then need

to set the colors for each point 1 at a time (Check the documentation on

this..you take #point + #series etc to set the color). If I understand what

you are seeing, every 4th point is the same color, right?

I have not used Gantt charts, so I am a bit clueless there.

Abe

I think

"Karl" <karl@lgc.com> wrote in message

news:SymhbJDYBHA.2752@webserver1.softwarefx.com...

> I tried using the:

> objChart.MultipleColors = True

> Approach.

> The results are that I get a "shift" in the colors that matches the number

> of "phases".

> That is, if I use 4 phases, then 25% have color 1 as the first phase, then

> it shifts to the second 25% have color 2, the third 25% have color 3 and

the

> last 25% have color 4 as the color of the first phase.

>

> What am I missing when taking this approach to getting the phases color

> coded?

>

> Thanks,

> Karl

>

> "Karl" <karl@lgc.com> wrote in message

> news:R7O0pFCYBHA.1472@webserver1.softwarefx.com...

> > How do I control the colors on Gantt charts? Especially to control the

> color

> > for "segments"?

> > I have many projects (let's say 10 for now) and each project has the

same

> 4

> > phases to them.

> > Desired result: Phase 1 is Yellow, Phase 2 Green, etc. for all projects.

> > In the Gantt examples it refers to series and segments. Here series =

> > projects and segments = phases.

> >

> > If I do the following:

> > objChart.OpenDataEx COD_COLORS,intProjectCount, 0

> > objChart.Series(0).Color = RGB(255, 255, 0) ' Yellow

> > objChart.CloseData COD_COLORS

> > it results in the first segment (phase) being yellow for ALL projects

> > (series).

> >

> > However, if I try it for other phases, such as below

> > objChart.OpenDataEx COD_COLORS,intProjectCount, 0

> > objChart.Series(0).Color = RGB(255, 255, 0) ' Yellow

> > objChart.Series(1).Color = RGB(0, 255, 0) ' Green

> > objChart.CloseData COD_COLORS

> > I get an error message - "Unknown runtime error"

> >

> > Thanks,

> > Karl

> >

> >

>

>

Link to comment
Share on other sites

That did the trick.

If I have n projects and m phases per project I was only opening m colors.

I changed the code to open (n*m) colors and everything worked like a charm.

Thanks for the help,

Karl

"Abram Krebs" <duckwood@erols.com> wrote in message

news:DmZm$2YYBHA.2488@webserver1.softwarefx.com...

> Karl,

>

> If you have X# of data points on a graph and want to use MultipleColors,

you

> need to do your OpenDataEx with that number of colors (X#). You then need

> to set the colors for each point 1 at a time (Check the documentation on

> this..you take #point + #series etc to set the color). If I understand

what

> you are seeing, every 4th point is the same color, right?

>

> I have not used Gantt charts, so I am a bit clueless there.

>

> Abe

>

>

> I think

> "Karl" <karl@lgc.com> wrote in message

> news:SymhbJDYBHA.2752@webserver1.softwarefx.com...

> > I tried using the:

> > objChart.MultipleColors = True

> > Approach.

> > The results are that I get a "shift" in the colors that matches the

number

> > of "phases".

> > That is, if I use 4 phases, then 25% have color 1 as the first phase,

then

> > it shifts to the second 25% have color 2, the third 25% have color 3 and

> the

> > last 25% have color 4 as the color of the first phase.

> >

> > What am I missing when taking this approach to getting the phases color

> > coded?

> >

> > Thanks,

> > Karl

> >

> > "Karl" <karl@lgc.com> wrote in message

> > news:R7O0pFCYBHA.1472@webserver1.softwarefx.com...

> > > How do I control the colors on Gantt charts? Especially to control the

> > color

> > > for "segments"?

> > > I have many projects (let's say 10 for now) and each project has the

> same

> > 4

> > > phases to them.

> > > Desired result: Phase 1 is Yellow, Phase 2 Green, etc. for all

projects.

> > > In the Gantt examples it refers to series and segments. Here series =

> > > projects and segments = phases.

> > >

> > > If I do the following:

> > > objChart.OpenDataEx COD_COLORS,intProjectCount, 0

> > > objChart.Series(0).Color = RGB(255, 255, 0) ' Yellow

> > > objChart.CloseData COD_COLORS

> > > it results in the first segment (phase) being yellow for ALL projects

> > > (series).

> > >

> > > However, if I try it for other phases, such as below

> > > objChart.OpenDataEx COD_COLORS,intProjectCount, 0

> > > objChart.Series(0).Color = RGB(255, 255, 0) ' Yellow

> > > objChart.Series(1).Color = RGB(0, 255, 0) ' Green

> > > objChart.CloseData COD_COLORS

> > > I get an error message - "Unknown runtime error"

> > >

> > > Thanks,

> > > Karl

> > >

> > >

> >

> >

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...