Jump to content
Software FX Community

SetScrollView Behaviour


richardcaunt
 Share

Recommended Posts

Hello,

I have a problem when using the SetScrollView function (of the AxisX property).  I have a position that is moving from one end of my graph to the other (i.e. 1 to 30,000) so i have 30,000 points. Every second (timer based) I am updating my scroll view by setting the minimum to be 100 points less of the position and the maximum to be 100 points higher.

Like this: |----------------------- (Min) |------ Position -------| (Max) ---------------------------------------|

I have handled the maths appropriately to set the scroll view at the ends of the graph (to stop weird behaviour - i.e. at the start the min is 1 and the max is 200).

If i leave the timer going my chart 'view' windows scrolls along as it should, however, at intermittent moments the graph jumps to show all 30,000 points (as if my min was 1 and my max was 30,000) and then on the next tick it jumps back to how it should be.

Does anyone know why this happens?

I also have a second problem whereby I am doing several things under the MouseClick event (single click), however if the user double clicks then ChartFX shows the whole graph and the user has to double click again to show the chosen scroll view.  Is it possible to disable this behaviour?

Many Thanks,

Link to comment
Share on other sites

Below is my source code:

  private void SetScrollView(int iPosition)   {   double dSize = 200.0;   double dHalf = 100.0;   double dMin = iPosition - dHalf;   double dMax;   if (dMin < 0.0)   {   dMin = 1.0;   dMax = dMin + dSize;   }   else   {   dMax = iPosition + dHalf;   if (dMax > m_iImageCount)   {   dMin = m_iImageCount - dHalf;   dMax = m_iImageCount - 1.0;   }   }   dMin = Math.Round(dMin / 10.0) * 10.0;   dMax = Math.Round(dMax / 10.0) * 10.0;   chart1.AxisX.SetScrollView(dMin, dMax);   }

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...