i attempted to enhance the barlabelling functions from the User KB.
when i added weekday, it does seem to print the weekday of the
cursor selected bar and not the weekday of the bar in context. how
do i fix it. it seems to work well in all other cases except weekday.
_SECTION_BEGIN("BAR LABELING");
ShowBars = ParamToggle("Label Bars","NO|YES",0);
LabelCo = ParamColor("Label",colorYellow);
Label = ParamList("Bar
Label","NUMBER|TIMENUM|DATENUM|BARNUM|WEEKDAY",0);
GraphXSpace = 10;
if( Showbars )
{
DN=DateNum();
TN=TimeNum();
FirstVisibleBar = Status( "FirstVisibleBar" );
Lastvisiblebar = Status("LastVisibleBar");
for( b = Firstvisiblebar, BN=0; b <= Lastvisiblebar AND b < BarCount;
b++)
{
if( Label == "NUMBER" ) BarLabel = NumToStr(BN++,1.0);
else if ( Label == "TIMENUM" ) BarLabel = NumToStr(TN[b],1.0);
else if (Label == "BARNUM" ) BarLabel= NumToStr(b,1.0);
if (Label == "WEEKDAY" ) BarLabel= NumToStr(DayOfWeek(),1.0);
else BarLabel= NumToStr(DN[b],1.0);
PlotText("\n^\n"+BarLabel,b,L[b]-(H[b]-L[b]),LabelCo);
}
}
_SECTION_END();