45239

DynamicDataDisplay zoom and tooltips on realtime charts with syncronous X axis

Question:

Some time ago I posted the <a href="https://stackoverflow.com/questions/19787080/how-to-make-the-x-axis-shared-for-2-charts-in-wpf-in-d3" rel="nofollow">question</a> about synchronous charts. I found the solution here, but I still have some problems.

<ul><li>I need to zoom in and out on Y axis on StrokeChart to see my date. I don't know why, but the range doesn't change on next added point. Actually range is 0-1 on Y axis. It's strange, but I can live with that</li> <li>The second question is: how to configure zoom on chart area? I want it to zoom only Y axis when I scroll up/down.</li> <li>And last, but not least: How to make realtime tooltips on chart which is build using ObservableCollection? It can be done for EnumerableDataSource easy. you can check <a href="http://dynamicdatadisplay.codeplex.com/discussions/50842" rel="nofollow">this</a> and <a href="http://dynamicdatadisplay.codeplex.com/discussions/270138" rel="nofollow">this</a>. I tried to do thing described by user "Thecentury", but it doesn't work. I even added method AddMapping to ObservableCollection and rebuilt the library, but it still doesn't work. So I don't know what to do next.</li> </ul>

I appreciate for any help and advice. Thank you

Answer1:

Regarding <strong>zooming</strong> I think I managed to solve the problem.

In <strong>MouseNavigation.cs</strong> 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.

Recommend

  • DynamicDataDisplay zoom and tooltips on realtime charts with syncronous X axis
  • Clarification on Azure Web App Scale Instance
  • Why does my Swift bundle get the wrong principal class?
  • How do scan a script for return values from a upper script in python?
  • syntax error: identifier 'DXGI_RGBA in file dxgi1_2.h
  • Are static c libraries created with one compiler compatible with another?
  • .Net Compact Framework 2.0: Deploying an app
  • how to resize an image whileing saving in an folder
  • Adding new strings to resource.resx not reflecting into Designer.cs
  • Version Control System that keeps original timestamps?
  • Eclipselink Inheritance policy causing malformed query
  • Missing SQL Management Studio
  • Spring CXF Soap Web Service Under Tomcat: No Services Found
  • this.dispatcher.invoke() does not work for multithreading?
  • Visual Studio cannot load type from global.asax
  • Metadata related exception when using Entity Framework 4
  • No OpKernel was registered to support Op 'Cos' when running inference on Android
  • Cordova 3.3 to 3.4, iOS Plugins don't load
  • Deployed Simple HelloWorld with Spring MVC app (without web.xml) gives 404 error
  • OpenCv Error in C Wrapper for imread: QNativeImage: Unable to attach to shared memory segment
  • invalid APK file
  • Make does not follow the dependencies chain
  • ViewData & Model does not exist in the current context
  • Java MethodOverloading error with double values
  • xsl: transform namespaced tags
  • CLang 3.5 LibTooling: getting file name of a variable in clang::VarDecl
  • Combining SpatialPolygonsDataFrame of two neighbour countries
  • Spring security and special characters
  • Does CUDA 5 support STL or THRUST inside the device code?
  • Trying to switch camera back to front but getting exception
  • Do create extension work in single-user mode in postgres?
  • Why winpcap requires both .lib and .dll to run?
  • R: gsub and capture
  • jqPlot EnhancedLegendRenderer plugin does not toggle series for Pie charts
  • Comma separated Values
  • Free memory of cv::Mat loaded using FileStorage API
  • Angular 2 constructor injection vs direct access
  • Programmatically clearing map cache
  • reshape alternating columns in less time and using less memory
  • How to load view controller without button in storyboard?