User (Legacy) 2 Posted October 22, 2004 Report Share Posted October 22, 2004 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; VARIANT var; VariantInit(&var); 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)); Thanks! LH Quote Link to post Share on other sites
Software FX 0 Posted October 25, 2004 Report Share Posted October 25, 2004 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 setting. You need to set values to ALL points. If you want to hide a point, set CHART_HIDDEN to its Y-Value. -- FP Software FX Quote Link to post Share on other sites
User (Legacy) 2 Posted October 25, 2004 Author Report Share Posted October 25, 2004 Thanks for the help! I tried to set CHART_HIDDEN to those hidden points' y values, but I got error: "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; else { 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! LH Quote Link to post Share on other sites
Software FX 0 Posted October 25, 2004 Report Share Posted October 25, 2004 You need to include CFXOCX.BAS in your VB project. CFXOCX.BAS is located under your Chart FX Installation folder \ include. -- FP Software FX Quote Link to post Share on other sites
Recommended Posts
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.