Jump to content
Software FX Community

Re: Many Dates on X-Axis


User (Legacy)

Recommended Posts

Here's what I do in those situations:   Basically, set the Min and Step 

attirbutes for the X axis to 0, and some large value (I use #prices / 10),

so in your case 3750/10 = 375. This way, there will be 10 distinct labels

along your X axis.....

Then, set the X axis label at each tick point to be the label you want. So,

in your case, point 0, point 375, point 750... here's the C++ code I use,

you'll do something similiar.....

int xtick = m_nprices / 10;

if (!xtick) xtick = 1;

pChartFX->Axis->Item[AXIS_X]->Min = 0;

pChartFX->Axis->Item[AXIS_X]->STEP = xtick;

for (i=0;i<m_nprices;i++) {

if (! (i%xtick)) {

sprintf (buf, "%02d/%02d/%02d",

m_prices[i].date.GetMonth (),

m_prices[i].date.GetDay (),

m_prices[i].date.GetYear () % 100

);

pChartFX->Axis->Item[AXIS_X]->Label[i] = buf;

}

}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...