Jump to content
Software FX Community

Re: Many Dates on X-Axis


User (Legacy)

Recommended Posts

Thanks for your reply Frank.. 

The problem I have now is that as soon as I set the STEP to 1, my labels

disappear because it seems to write " "'s into the non-used labels. I am

sure I am doing something fundamentally wrong and I have included my code

hoping you will look at it and immediately work out what a dunce I am...

Regards

Jon Sherren

public npoints

close datab

use p_1

sele open, high, low, close, vol, date from p_1 into array ppp

npoints = _tally

sdate = year(ppp(1,6))

with thisform.chartfx1

** read previously saved template

.import(CHART_CFXOLETEMPLATE,"e:\template.chd")

.gallery = OPENHILOWCLOSE

.OpenDataEx (COD_VALUES,4,npoints)

for j = 0 to npoints-1

* only label when the year changes

if sdate <> year(ppp(j+1,6))

.axis(AXIS_X).label(j) = ppp(j+1,6)

sdate = year(ppp(j+1,6))

endif

.valueEx(OHLC_open,j) = ppp(j+1,1)

.valueEx(OHLC_high,j) = ppp(j+1,2)

.valueEx(OHLC_low,j) = ppp(j+1,3)

.valueEx(OHLC_close,j) = ppp(j+1,4)

next j

.closeData (COD_VALUES)

*.axis(AXIS_X).tickmark = TS_NONE &&&& try turning off the tickmarks

.adm(CSA_XGAP) = 1

.Axis(AXIS_X).Grid = .f.

.Axis(AXIS_X).Format = "Dyyyy"

.Axis(AXIS_Y).min = 300

endwith

Francisco Padron wrote in message ...

>So, you want an "uneven" step (the physical distance between two

consecutive

>labels can vary) ?, If so, the only way you can achieve this is by manually

>setting the X-Axis labels ONLY for those points that you want to label. In

>your case that will be one label per year. For instance, you may want to

>label the first point of each year.

>

>You can use the Label property to set these labels.

>

>Note: You need to set the X-Axis Step to 1.

>

>Frank

>SFX

>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...