Jump to content
Software FX Community

Scrollable XY Scatter plot question

User (Legacy)

Recommended Posts


I'm trying to setup a scrollable XY scatter plot, where new data is going to

be shown at intervals.

As a test, I tried to edit the XYChart demo sample app, by changing the

OnXValues callback to the code below, but when the button is selected the

first time, the chart displays all data (no scrollbar) on the second (and

subsequent) selections the scrollbar appears. Can you see what I'm doing

wrong? (I'm not sure if it has to do with the fact that the

X-axis has values that are all < 1.0)



// OnXValues() callback method


int i;

ICfxAxisPtr pAxis;

m_pChartFX->ClearData((enum CfxDataMask)(CD_VALUES | CD_XVALUES));

m_pChartFX->OpenDataEx(COD_VALUES, 1, 100);

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



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

m_pChartFX->XValueEx[0][i] = i/ 1000.0;


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

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

pAxis = (ICfxAxisPtr)m_pChartFX->Axis->Item[AXIS_X];

pAxis->Decimals = 3;

pAxis->STEP = .01;

pAxis->MinorStep = .001;


pAxis->SetScrollView(0, .01);


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