Jump to content
Software FX Community

Reset control to default state


User (Legacy)

Recommended Posts

We do not expose a Reset method, but you can use the following approach

// ... Customize your default chart here

MemoryStream memStream = new MemoryStream();

chart1.Export(FileFormat.Binary,memStream);

// To reset the chart simply do

memStream.Position = 0;

chart1.Import(FileFormat.Binary,memStream);

Note that this allows you to specifically define the chart state you want to

use as default or have more than 1 predefined state.

--

Regards,

JC

Software FX Support

"Rob" <spam@spam.com> wrote in message

news:pqa4lIsiEHA.3888@webserver3.softwarefx.com...

> What's the best way of restoring the control to it's default state?

>

> I thought calling chart.ClearData(ClearDataFlag.AllData) would do the

> trick,

> but it seems that many things are not reset.

>

> Some of the properties that remain after calling ClearData are

> - chart.PointLabelAlign

> - chart.PointLabelFont

> - chart.PointLabelColor

> - chart.AxisX.Step and chart.AxisY.Step

>

> I guess I could destroy & recreate the control, but I'd rather not =)

>

> cheers!

> Rob

>

>

Link to comment
Share on other sites

What's the best way of restoring the control to it's default state?

I thought calling chart.ClearData(ClearDataFlag.AllData) would do the trick,

but it seems that many things are not reset.

Some of the properties that remain after calling ClearData are

- chart.PointLabelAlign

- chart.PointLabelFont

- chart.PointLabelColor

- chart.AxisX.Step and chart.AxisY.Step

I guess I could destroy & recreate the control, but I'd rather not =)

cheers!

Rob

Link to comment
Share on other sites

lovely, thanks

R

"Software FX Support" <noreply> wrote in message

news:MSbH8GviEHA.3152@webserver3.softwarefx.com...

> We do not expose a Reset method, but you can use the following approach

>

> // ... Customize your default chart here

> MemoryStream memStream = new MemoryStream();

> chart1.Export(FileFormat.Binary,memStream);

>

> // To reset the chart simply do

> memStream.Position = 0;

> chart1.Import(FileFormat.Binary,memStream);

>

> Note that this allows you to specifically define the chart state you want

to

> use as default or have more than 1 predefined state.

>

> --

> Regards,

>

> JC

> Software FX Support

> "Rob" <spam@spam.com> wrote in message

> news:pqa4lIsiEHA.3888@webserver3.softwarefx.com...

> > What's the best way of restoring the control to it's default state?

> >

> > I thought calling chart.ClearData(ClearDataFlag.AllData) would do the

> > trick,

> > but it seems that many things are not reset.

> >

> > Some of the properties that remain after calling ClearData are

> > - chart.PointLabelAlign

> > - chart.PointLabelFont

> > - chart.PointLabelColor

> > - chart.AxisX.Step and chart.AxisY.Step

> >

> > I guess I could destroy & recreate the control, but I'd rather not =)

> >

> > cheers!

> > Rob

> >

> >

>

>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...