Jump to content
Software FX Community

Autoscale / smart labels and minor step


User (Legacy)

Recommended Posts

[Chartfx v6.2 for windows forms.net]

I'm using the Autoscale feature with a date-time or time axis to get nice

'round' values. It works great.

How do I set the MinorStep interval to be nice sub increments of the step?

The Step property always has the value -1, so I cannot get the value of the

Step and divide it sensibly to set the minor step interval.

Thanks

John

Link to comment
Share on other sites

> How do I set the MinorStep interval to be nice sub increments of the step?

Well, that depends on what " nice sub increments" means.

By default the Step is calculated every the scale is changed, so asking for

the value of Step will give you different result depending on when you call

it.

After the chart its drawn, you can ask for the value of Step, it will return

you the current step as a negative number (to let you know is not actually

fixed). You can take that Step, divide it and then assign MinorStep (as a

positive value) but you will need to do this everytime the scale changes.

--

FP

Software FX

Link to comment
Share on other sites

  • 3 weeks later...

What's the best method to find out when the scale has changed? It there an

event to hook?

It's reasonable to assume that the scale will change when my application

adds data to the chart, and when the chart is resized, but what other

circumstances cause the scale to change?

Thanks

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

news:3rdHP%23YpEHA.688@webserver3.softwarefx.com...

> > How do I set the MinorStep interval to be nice sub increments of the

step?

>

> Well, that depends on what " nice sub increments" means.

>

> By default the Step is calculated every the scale is changed, so asking

for

> the value of Step will give you different result depending on when you

call

> it.

>

> After the chart its drawn, you can ask for the value of Step, it will

return

> you the current step as a negative number (to let you know is not actually

> fixed). You can take that Step, divide it and then assign MinorStep (as a

> positive value) but you will need to do this everytime the scale changes.

>

> --

> FP

> Software FX

>

>

Link to comment
Share on other sites

There a many circumstances in which the scale changes. Here are a few, just 

to give you an idea of the many cases:

- Min/Max changes

- Zoom

- Resize of the plotting area. This can occur for many reasons, among them:

- Resize of the chart control

- Adding a title

- Changing the font of a title or axis labels

- Changing the size of a legend box

- Adding/Removing a legend box, data editor, toolbar, menubar

- Going from 3D to 2D or viceversa

However, a change in size doe not necessarily mean a change in the Step.

The only way to capture them all is to trap the PrePaint event, compare your

old step with the new one and if it's different then act.

Note that since you are already in a Paint event, setting a property (such

as MinorStep) will cause another Re-Paint and therefore another call to

PostPaint so beware of infinite loops here.

--

FP

Software FX

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...