Time Axis Color - Small Help Needed

radiosilk

Active Member
#1


Can the Time-X Axis / Text Background color be adjusted using afl code (without changing Background color in Preferences Window)?


Hi,

My screen is glossy which results in lot of reflection during day time and hence head and eyes ache.

This happens only if my Amibroker Background is Black.

Hence, I use a white background during day time.

But during evenings i prefer to use the black bg as shown in the above pic. I use the below code to change the bg color:
SetChartBkColor(ParamColor("BG Color",colorblack ));

But that leaves my time axis with white patches under Time Text.

Can anyone please guide me what should i do to get Black X-Axis Time Bg using AFL without changing anything in Preferences / Settings window ?
 
Last edited:

amitrandive

Well-Known Member
#2


Hi,

My screen is glossy which results in lot of reflection during day time and hence head and eyes ache.

This happens only if my Amibroker Background is Black.

Hence, I use this white background during day time.

But during evenings i prefer to use the black bg as shown in the above pic. I use the below code to change the bg color:
SetChartBkColor(ParamColor("BG Color",colorblack ));

But that leaves my time axis with white patches under Time Text.

Can anyone please guide me what should i do to get Black X-Axis Time Bg without changing the default settings ?
Add this code in your AFL,gives various colour options..

Code:
	_SECTION_BEGIN("Background Color");
BKswitch = ParamToggle("Background Color","On,Off");
 
OUTcolor = ParamColor("Outer Panel Color",colorLightBlue);
INUPcolor = ParamColor("Inner Panel Upper",colorLightYellow);
INDNcolor = ParamColor("Inner Panel Lower",colorSeaGreen);
TitleColor = ParamColor("Title Color ",ColorRGB(245,245,245));
 
if (NOT BKswitch)
{
SetChartBkColor(OUTcolor); // color of outer border
SetChartBkGradientFill(INUPcolor,INDNcolor,TitleColor); // color of inner panel
}
_SECTION_END();
 

amitrandive

Well-Known Member
#4


Amit, this doesn't work.

i had tried this AFL already. It doesn't change the date-time x-axis text-background color.
This will help you change the background.
For changing the color of the text of the axis,go to
Tools=Preferences=Colors and change the color as per your requirement.

 

burai123

Active Member
#5
try - amibroker > preference > axis/grids > predefined chart theme and set it black/basic according to your chart background.
 

radiosilk

Active Member
#6
Hi Amit,

I know about Preferences window. But then i will have to change color from that window each time i shift from one color to other

Can't the Time-Text Background color be adjusted using afl code ?
 

colion

Active Member
#8


Can the Time-X Axis / Text Background color be adjusted using afl code (without changing Background color in Preferences Window)?


Hi,

My screen is glossy which results in lot of reflection during day time and hence head and eyes ache.

This happens only if my Amibroker Background is Black.

Hence, I use a white background during day time.

But during evenings i prefer to use the black bg as shown in the above pic. I use the below code to change the bg color:
SetChartBkColor(ParamColor("BG Color",colorblack ));

But that leaves my time axis with white patches under Time Text.

Can anyone please guide me what should i do to get Black X-Axis Time Bg using AFL without changing anything in Preferences / Settings window ?
I think you will have to use the gfx-type functions.
 

sr114

Well-Known Member
#10


Can the Time-X Axis / Text Background color be adjusted using afl code (without changing Background color in Preferences Window)?


Hi,

My screen is glossy which results in lot of reflection during day time and hence head and eyes ache.

This happens only if my Amibroker Background is Black.

Hence, I use a white background during day time.

But during evenings i prefer to use the black bg as shown in the above pic. I use the below code to change the bg color:
SetChartBkColor(ParamColor("BG Color",colorblack ));

But that leaves my time axis with white patches under Time Text.

Can anyone please guide me what should i do to get Black X-Axis Time Bg using AFL without changing anything in Preferences / Settings window ?

use this

Code:
 SetChartBkGradientFill( ParamColor("BgTop", colorBlack),
 ParamColor("BgBottom", colorDarkGrey),ParamColor("TitleBack",colorBlack)); 
 SetChartBkColor(ParamColor("Outer Panel",colorBlack));