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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...