Some time ago I posted the question about synchronous charts. I found the solution here, but I still have some problems.
AddMapping
to ObservableCollection and rebuilt the library, but it still doesn't work. So I don't know what to do next. I appreciate for any help and advice. Thank you
Regarding zooming I think I managed to solve the problem.
In MouseNavigation.cs add new properties
// 2014-02-22 - MPEKALSKI - added property to make possible
limiting on zoom on only one axis
private bool? _zoomX;
/// <summary>
/// Property for allowing/disallowing for zoom along X axis. By default allowed (true).
/// </summary>
public bool zoomX
{
get { return _zoomX ?? true; }
set { _zoomX = value; }
}
private bool? _zoomY;
/// <summary>
/// Property for allowing/disallowing for zoom along Y axis. By default allowed (true).
/// </summary>
public bool zoomY
{
get { return _zoomY ?? true; }
set { _zoomY = value; }
}
In the same class modify the method
private void MouseWheelZoom(Point mousePos, int wheelRotationDelta)
by substituting
Viewport.Visible = Viewport.Visible.Zoom(zoomTo, zoomSpeed);
with
// 2014-02-23 - MPEKALSKI - if we do not allow for change in Y
// then keep the old value, by analogy for X
Rect zoomedRect = Viewport.Visible.Zoom(zoomTo, zoomSpeed);
if (zoomY == false) { zoomedRect.Y = Viewport.Visible.Y;
zoomedRect.Height = Viewport.Visible.Height; }
if (zoomX == false) { zoomedRect.X = Viewport.Visible.X;
zoomedRect.Width = Viewport.Visible.Width; }
Viewport.Visible = zoomedRect;
The use now is pretty straightforward given chartPlotter object just set properties zoomY or zoomX to false to prevent zooming along this axis.
chartPlotter2.MouseNavigation.zoomY = false;
I do not know is it the most optimal solution, but it works for me.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.