User (Legacy) Posted September 28, 2004 Report Share Posted September 28, 2004 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 More sharing options...
Software FX Posted October 1, 2004 Report Share Posted October 1, 2004 Try the following: Call UpdateSizeNow right before calling SetScrollView, you may be having a timing problem in which by the time you reach SetScrollView the scale is still not appropriate. Another thing, make sure the Scrollable property in the chart is set to true. -- FP Software FX Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.