This project is read-only.

Is there a way to ensure the Top scale number in Y-axis always visible?

Aug 6, 2009 at 7:55 AM

We follow the Simulation project to dynamicaly display data to implement our real time data display.

One of the problem is that the Top scale in y-axis sometimes only shows partial number. It looks like the Top scale changes as maximum Y data plot value changes.

Is there a way we can overcome this problem?

such as Set the Top scale a little big than the maximum real y data value, so the top scale number always show on the y-axis.


Aug 9, 2009 at 3:10 AM


You arу right - as data changes, its bounding box changes, too, and visible area changes to fit this bounding box. Axes takes their values to display from this visible area.

All this happens when Viewport is in 'FitToView' state, in which it changes its displayed area dynamically when charts change their size. You can set fixed size for Viewport.Visible, or you can use viewport restrictions - for example, FitToViewRestrictions to set y maximum to stable value - you should only create a descendant of ViewportRestriction class and do all the work in one overriden method, and then add a new instance of you restriction to Viewport.FitToViewRestrictions collection. These restrictions are applied only when plotter is in 'FitToView' state, and other group of restrictions - simply Viewport.Restrictions are applied always. Restriction is a small piece of code that can influence on what final value Viewport.Visible will take.


Best regards,