User (Legacy) Posted January 14, 2005 Report Share Posted January 14, 2005 Hi, If i call ClearData(CD_ALLDATA), then the CHART_VALUESFT colour in the RGBFont property is not reset ie. m_pChart->RGBFont[CHART_VALUESFT] = RGB(255,0,0); VERIFY(m_pChart->ClearData(CD_ALLDATA) != CR_FAIL); ASSERT(m_pChart->RGBFont[CHART_VALUESFT] != RGB(255,0,0)); It does seem as though the other properties are being reset, although I haven't exhaustively checked them. Cheers, Steve. Link to comment Share on other sites More sharing options...
Software FX Posted January 14, 2005 Report Share Posted January 14, 2005 ClearData is not suppose to reset all values to default. All ClearData does is free all the Dynamic memory allocated by the chart. If you want to revert the chart to an specific state, save the chart using the Export function and then use Import to restore it. Notice that a "default" chart may have different meanings in different contexts. For example, if the chart was added at design-time, is the default chart the chart that was set-up at design time ? or maybe there was some initialization code in the Form_Load, is that part of the default chart ? For these reasons, the Export-Import approach is the best as it gives you the freedom to define what a "default" chart is. -- FP Software FX Link to comment Share on other sites More sharing options...
User (Legacy) Posted January 16, 2005 Author Report Share Posted January 16, 2005 SoftwareFX Support wrote: > ClearData is not suppose to reset all values to default. All ClearData does > is free all the Dynamic memory allocated by the chart. But thats not what the documentation says for the ClearData method: CD_COLORSANDPATTERNS 32 Clear Color and patterns and return to Chart FX defaults. I'm using CD_ALLDATA which is supposed to included all the constants listed in the documentation. The current behaviour is inconsistent because some colors are reset whilst others (ie the one I mentioned) are not. Link to comment Share on other sites More sharing options...
Software FX Posted January 17, 2005 Report Share Posted January 17, 2005 I agree that the documentation is not very clear here. CD_COLORSANDPATTERNS clears the SERIES colors, which are the only "dynamic" color arrays the number of series is dynamic. Other colors, such as background, etc, are not dynamic arrays and therefore not affected by ClearData. Anyway, did the explanation about Import/Export helped you achieve what you are looking for ? -- FP Software FX Link to comment Share on other sites More sharing options...
User (Legacy) Posted January 17, 2005 Author Report Share Posted January 17, 2005 SoftwareFX Support wrote: > I agree that the documentation is not very clear here. > > CD_COLORSANDPATTERNS clears the SERIES colors, which are the only "dynamic" > color arrays the number of series is dynamic. > > Other colors, such as background, etc, are not dynamic arrays and therefore > not affected by ClearData. > > Anyway, did the explanation about Import/Export helped you achieve what you > are looking for ? > ok, that makes sense. The import/export should work in our case, thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.