Fixed values in the vertical axis

Oct 14, 2009 at 12:04 AM

Hi, in the current implementation I see that the values in an axis constantly adjust depending on the data in the chart, I need to have the vertical axis values to always be between 0 and 100. This will allow one to evaluate the change in the data, currently with adjustable axis, the scale constantly changes.

Is there a way to achieve that?

Oct 14, 2009 at 2:52 PM

Hi, there are different ways to archieve what you want:

1) you can set the plotter.Viewport.Visible property to some value that is good for you, for example, to new DataRect(xMin, 0, width, 100);

2) you can create a new class deriving from ViewportRestriction with the following code inside


public DataRect Apply(DataRect previousDataRect, DataRect proposedDataRect, Viewport2D viewport) {
  proposedDataRect.YMin = 0;
  proposedDataRect.Height = 100;
  return proposedDataRect;

and then add an instance of this restriction to plotter.Viewport.Restrictions collection.

This will allow user to pan the chart horizontally but will restrict visible area to have fixed ystart and height.



Oct 14, 2009 at 6:11 PM

Thanks, the second approach worked pretty well in my scenario.