Howdy! I’m Ross, and I’ve been trying out SciChart as a replacement for Dynamic Data Display in a program I’m working on. So far, SciChart has better documentation, support, and features, which is great. Once I’m at the level where I was with the previous tool, this will likely be the one I purchase. But there was a good behavior I liked in D3 that I’m struggling to implement in SciChart.
I want the scroll wheel behavior to only zoom on a single axis when the mouse is over that axis. So if I move my mouse over the x-axis and scroll, I want it to only change that axis’ space.
So, for example, “Drawing a line graph” here: http://research.microsoft.com/en-us/um/cambridge/projects/ddd/d3isdk/
I think the key is my inability to find the region that the axes occupy. I know I can trigger on entering or leaving the region to change behavior from there. Is there an easy way to find these values?
If this is in some example I haven’t seen or has been answered before, I’d be appreciative of a link, as well! Thanks!
- boss1000 asked 11 years ago
- You must login to post comments
Got it working! I ended up using some different code to get the job done, which I’ll share here:
// Custom mouse wheel usage public override void OnModifierMouseWheel(ModifierMouseArgs e) { // Get region of axis Rect XAxisBounds = XAxis.GetBoundsRelativeTo(RootGrid); Rect YAxisBounds = YAxis.GetBoundsRelativeTo(RootGrid); // Only zoom in that axis if mouse over axis if (XAxisBounds.Contains(e.MousePoint)) { // If zooming in if (e.Delta > 0) XAxis.ZoomBy(-0.1, -0.1); // If zooming out else if (e.Delta < 0) XAxis.ZoomBy( 0.1, 0.1); // Now don't do anything else e.Handled = true; return; } else if (YAxisBounds.Contains(e.MousePoint)) { if (e.Delta > 0) YAxis.ZoomBy(-0.1, -0.1); else if (e.Delta < 0) YAxis.ZoomBy( 0.1, 0.1); e.Handled = true; return; } // Otherwise, operate normally base.OnModifierMouseWheel(e); }
Your initial points and several key methods helped out a lot! I also simplified some parts I didn’t need. Thanks!
- boss1000 answered 11 years ago
-
Cool, thanks for sharing your modifier code! Best regards, Andrew
- You must login to post comments
I am considering applying server-side licensing for my javerScript application.
In the document below, there is a phrase “Our server-side licensing component is written in C++.”
(https://support.scichart.com/index.php?/Knowledgebase/Article/View/17256/42/)
However, there is only asp.net sample code on the provided github.
(https://github.com/ABTSoftware/SciChart.JS.Examples/tree/master/Sandbox/demo-dotnet-server-licensing)
I wonder if there is a sample code implemented in C++ for server-side licensing.
Can you provide c++ sample code?
Also, are there any examples to run on Ubuntu?
- Andrew Burnett-Thompson answered 11 years ago
-
Thanks a lot for the reply. I'll hopefully get to trying this out soon. I'm familiar with ChartModifiers since what I'm displaying are actually almost exclusively annotations. This tutorial was crucial: http://www.scichart.com/databinding-annotations-with-mvvm/ From looking at this for a bit, I assume what we're doing is co-opting the panning function to zoom.
- You must login to post comments
Please login first to submit.