Jump to content
Software FX Community

ClearData(CD_ALLDATA) doesn't clear everything


User (Legacy)
 Share

Recommended Posts

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

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

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

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

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

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.

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

 Share

×
×
  • Create New...