Jump to content
Software FX Community

Y axis Auto scaling

User (Legacy)

Recommended Posts

I'm using ChartFX .Net 6.2. I have embedded the ChartFX control onto a form, 

which allows the user to set appearance options relating to their chart.

Now I see from your knowledge base article Q7102046 says that once min/max

values for the Y-axis have been set to explicit values they cannot be set

back to Auto. The KB article says this is by design and presents some code

to achieve the same. Trouble is, how does the end user achieve this? We have

a form that embeds ChartFX's control, and the user can change the Y axis

properties by Right clicking the Y axis to see a ChartFX dialog, with 3 tabs

and the Y-axis tab highlighted. The Y axis tab contains text boxes for

editting the min/max values for the Y axis.

Values of Auto entered into min/max are ignored as explained by the

knowledge base article. So it appears there is no way to set the auto

scaling back using this form. The only solution to this problem seems to be

to scrap the use of the Chart FX control in our form and build everything

ourselves and just set the API. This is not a very desirable workaround. Big

question is, why is this limitation by design? Will ChartFX not consider

putting a button on this form to allow the Auto scaling to be reset?



Link to comment
Share on other sites

The reason is complicated. Complicated scenarios with multiple axes, units 

etc. makes this option very dangerous. You need to realize that your

scenario is just one of many possible.

Since you know your scenario better, you can provide a simple UI to

Re-Calculate the chart scale. You only need to program this ONE UI, I don't

see a reason why you will need to stop using all the rest, you can provide

this UI as a custom command (User Command) in Chart FX or in your own


The command will simply do the code listed in the article:

axis.AutoScale = true;


Also, you could ask the user whether he wants to recalculate the scale upon

exiting the options dialog, in this case, you will receive an

InternalCommand event with ID = CommandID.Apply.

If you want to prevent your users from changing the Min and Max, you can do:

chart1.Style &= ~ChartStyle.Scale;


Francisco Padron


Link to comment
Share on other sites


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

  • Create New...