Jump to content
Software FX Community

Scrollable XY Scatter plot question


User (Legacy)

Recommended Posts

Hello,

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)

Thanks,

Chris

// 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);

for(i=0;i<100;i++)

{

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;

m_pChartFX->RecalcScale();

pAxis->SetScrollView(0, .01);

}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...