Jump to content
Software FX Community

Calling Chart.Rescale() not always working


User (Legacy)

Recommended Posts

Sorry it's Axis.ResetScale().

If we update a series and now the Max and Min values are different from

before, we want the chart to scale to the new Max and Min.

The change to the Max and Min was not by setting the property but by

changing the values of the series. For example if the max value added to

Values[s, p] = 100 and now we change it where the the great point is now 50

we want the chart to rescale to a max of this new value.

"SoftwareFX Support" <noreply@softwarefx.com> wrote in message

news:mj9EF7DAGHA.2536@webserver3.softwarefx.com...

> There is no Rescale method in the Axis object (or anywhere that I can

> find).

>

> What are you trying to do ?

>

> --

> Francisco Padron

> www.chartfx.com

>

Link to comment
Share on other sites

You can call ResetScale BEFORE re-assigning data to the chart then the scale 

will be calculated based on the NEW data only. You MUST pass data or assign

Min/Max after calling ResetScale otherwise the scale will remain "infinite"

and the chart will not draw.

You can also call chart.RecalcScale to calculate all axes scales AFTER

passing data to the chart.

--

Francisco Padron

www.chartfx.com

untitled.bmp

Link to comment
Share on other sites

Calling chart.RecalcScale() doesn't rescale it when the X axis is a double 

(see attached).

If the X axis is a DateTime then it is fine.

"SoftwareFX Support" <noreply@softwarefx.com> wrote in message

news:p3lXCPZAGHA.3496@webserver3.softwarefx.com...

> You can call ResetScale BEFORE re-assigning data to the chart then the

> scale

> will be calculated based on the NEW data only. You MUST pass data or

> assign

> Min/Max after calling ResetScale otherwise the scale will remain

> "infinite"

> and the chart will not draw.

>

> You can also call chart.RecalcScale to calculate all axes scales AFTER

> passing data to the chart.

>

> --

> Francisco Padron

> www.chartfx.com

>

>

untitled.bmp

Link to comment
Share on other sites

The X-Axis is also re-calculated, what I think you are experiencing is 

something else:

By default, all axis have ForceZero set to true, ForceZero means that the

Min value will be AT THE MOST zero (0), even if all values are greater than

zero, if you want your X-Axis Min to be greater than zero you must set

AxisX.ForceZero = false. You only need to set this property once before

setting any data or calling RecalcScale.

--

Francisco Padron

www.chartfx.com

post-2107-13922380922401_thumb.gif

Link to comment
Share on other sites

That fixed it. Thanks!

"SoftwareFX Support" <noreply@softwarefx.com> wrote in message

news:convAtoAGHA.564@webserver3.softwarefx.com...

> The X-Axis is also re-calculated, what I think you are experiencing is

> something else:

>

> By default, all axis have ForceZero set to true, ForceZero means that the

> Min value will be AT THE MOST zero (0), even if all values are greater

> than zero, if you want your X-Axis Min to be greater than zero you must

> set AxisX.ForceZero = false. You only need to set this property once

> before setting any data or calling RecalcScale.

>

> --

> Francisco Padron

> www.chartfx.com

>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...