Page 1 of 1
Setting Series Color
Posted: Thu Mar 13, 2008 4:12 pm
by 15047739
How do I specifically set the color of the lines in a series? Suppose I want to set the color of the lines to red, or blue, or any color, how do I do that?
Is there a specific constant for each different color?
Posted: Fri Mar 14, 2008 8:33 am
by narcis
Hi marathoner,
You can do this:
Code: Select all
m_Chart1.Series(0).SetColor(RGB(255,0,0));
In VC++ there are no color constants that I know of.
Posted: Fri Mar 14, 2008 11:21 am
by 15047739
What is the meaning of RGB(255,0,0)?
Posted: Fri Mar 14, 2008 11:37 am
by narcis
Hi marathoner,
This is a GDI method. If you have a look at its
MSDN Library entry you'll find something like this:
RGB
The RGB macro selects a red, green, blue (RGB) color based on the arguments supplied and the color capabilities of the output device.
COLORREF RGB(
BYTE byRed, // red component of color
BYTE byGreen, // green component of color
BYTE byBlue // blue component of color
);
Parameters
byRed
Specifies the intensity of the red color.
byGreen
Specifies the intensity of the green color.
byBlue
Specifies the intensity of the blue color.
Return Values
The return value is the resultant RGB color as a COLORREF value.