0

I have a question about zooming and scrolling. My scroll function doesn't work perfectly, but close enough. Instead of the Maximum value I want to change the ActualMaximum, but that one was protected.

plotBSITotalA.Model.Axes[0].Maximum = hScrollBarA.Value + 
  (plotBSITotalA.Model.Axes[0].ActualMaximum - plotBSITotalA.Model.Axes[0].ActualMinimum);
plotBSITotalA.Model.Axes[0].Minimum = hScrollBarA.Value;

Ok, here comes the real problem: When I have zoomed in or out, the scroll function won't work anymore in that specific plot Area, where it have been zoomed. Other plotArea's that weren't zoomed, will work perfectly.

Does somebody know, how I can scroll when I zoomed in??

Noctis
  • 11,507
  • 3
  • 43
  • 82
E. Verdi
  • 310
  • 2
  • 19

2 Answers2

0

May be, It can be done by connecting two enevts with two methods: 1. event emitted when scrollbar changed with method of changing axes range 2. event emitted when axes range changed with method of changing the scrollbar position

Sairus
  • 384
  • 1
  • 15
0

Quite a few views, so maybe still a problem.

As I understand it, your saying the auto scroll stops when you have zoomed back out and subsequently add new values to the series? Can't find a formal solution, but this works for me

add this to your axis:

xAxis.AxisChanged += OnXAxisChange;

add the method

 bool doAxisReset = false;
 private void OnXAxisChange(object sender, AxisChangedEventArgs e)
 {
      //if zoomed fully out, then enable auto scroll
      //
      if ((e.DeltaMaximum == 0) && (e.DeltaMinimum == 0))
      {
        doAxisReset = true;               
      }
  }

In the rendering code (ie when you get a new element that triggers autoscrolling) and before InvalidatePlot

if (doAxisReset)
{
      xAxis.Reset();
      doAxisReset = false;
}
MarkS
  • 1
  • 1