Jump to content
Software FX Community

plot xy chart with logarithm x-axis

User (Legacy)

Recommended Posts

Dear Support People,

When I plotted a XY chart with logarithm x-axis in VC++/MFC, except the

curve i should get, i found the chart also draws a straight line from the

first point to somewhere else. What can I do with it?

The codes I wrote is:

m_pChartFX->Axis->Item[AXIS_X]->LogBase = 10;



V_VT(&var) = VT_I4;

var.intVal = AF_SCIENTIFIC;

m_pChartFX->Axis->Item[AXIS_X]->Format = var;

m_pChartFX->Axis->Item[AXIS_X]->Min = 0.000001;

m_pChartFX->Axis->Item[AXIS_X]->Max = 1;

m_pChartFX->Axis->Item[AXIS_Y]->Min = 0;

m_pChartFX->Axis->Item[AXIS_Y]->Max = 1;

m_pChartFX->OpenDataEx(COD_XVALUES, 1, 41);

for(i=60; i<101; i++)


m_pChartFX->ValueEx[0][i] = 1-y[i]/100;

m_pChartFX->XValueEx[0][i] = (x[i]/100);


m_pChartFX->CloseData((CfxCod) (COD_XVALUES));



Link to comment
Share on other sites

This is because you are leaving some point uninitialized (from 0 to 59). 

Uninitialized points will default to ZERTO for both X and Y values. The line

that you see is the one going from (0,0) to the first data point you are


You need to set values to ALL points. If you want to hide a point, set

CHART_HIDDEN to its Y-Value.



Software FX

Link to comment
Share on other sites

Thanks for the help!

I tried to set CHART_HIDDEN to those hidden points' y values, but I got


"CHART_HIDDEN": undeclared identifier'.

My codes are (in VC++/MFC):

m_pChartFX->OpenDataEx(COD_XVALUES, 1, 101);

for(int i=0; i<101; i++)


if(x[i] == 0)

m_pChartFX->ValueEx[0][i] = CHART_HIDDEN;



m_pChartFX->ValueEx[0][i] = 1-y[i]/100;

m_pChartFX->XValueEx[0][i] = x[i]/100;



Could you tell me what is the problem? Thanks a lot!


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...