Pre loader

RubberBandXyZoomModifier Independent Zoom from Other Charts

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

Hi,
I’m loading my charts in an Observable collection in an itemscontrol.

I’ve successfully synchronize my charts with the ChartModifiers but I do not want the RubberBandXyZoomModifier to be synced.

I’ve set IsXAxisOnly=”False” and ReceiveHandledEvents=”False” for the RubberBandXyZoomModifier and this works perfectly in the first chart. I can drag zoom on the first chart and it will zoom on the X and Y-Axis for the first chart while zooming on the X-axis only for the other charts.

However when I try to drag zoom on subsequent charts the drag zoom is applied to the first chart only.

Setting ReceiveHandledEvents=”True” is not what I want because it applies the X and Y-Axis zoom on all the charts.

See attached.

How can I apply the RubberBandXyZoomModifier independently from other charts?

Johnny

Attachments
  • You must to post comments
0
0

Hi,

You need to extend existing zoom modifier in such a way:

    class RubberBandXyZoomModifierEx : RubberBandXyZoomModifier
    {
        public override void OnModifierMouseDown(ModifierMouseArgs e)
        {
            // Start dragging only in the case when on master chart
            if (e.IsMaster)
            {
                base.OnModifierMouseDown(e);
            }
        }
    }

Use it for all subsequent charts. Hope this helps!

Best regards,
Yuriy

  • johnnyp112
    Thanks Yuriy, I put this in the code behind for ChartView.xaml.cs and call:
    <local:RubberBandXyZoomModifierEx ReceiveHandledEvents="False" IsXAxisOnly="False" ExecuteOn="MouseLeftButton"/>
    
    This seems to work as it does not show the drag box in the first chart and zooms in the second chart but it does not show the drag box in the second chart. What am I missing or what am I doing wrong? Johnny
  • Yuriy Zadereckiy
    Hi Johnny, Just to be sure, do you want to zoom each chart separately? They shouldn't be synchronized neither on XAxis, nor on YAxis? RubberBandXyZoomModifier isn't synchronized now, but you have XVisibleRange shared across the charts, so changes in the first chart trigger changes in other charts. Best regards, Yuriy
  • johnnyp112
    I want the XAxis to be synchronized. The YAxis should not be synchronized though when using the RubberBandXyZoomModifier. Your solution above works but I am missing the drag box in subsequent charts. Thanks, Johnny
  • Yuriy Zadereckiy
    Hi, Thanks for explanation, seems that I misunderstood you previously. OK, in this case you don't need custom modifier. Try to set IsXAxisOnly="True" for all RubberBandXyZoomModifiers except the one belonging to the main (first) chart. Please, let me know if this helps, Regards, Yuriy
  • johnnyp112
    I'm not sure how to implement what you are suggesting. From my example, I'm displaying the chart from an observable collection to allow adding charts dynamically. All charts are derived from the same ChartView so how can I set the RubberBandXyZoomModifier for any subsequent charts? From your first suggestion with extending the RubberBandXyZoomModifier, this functionally gives me what I needed but the visual drag box does not show in any subsequent charts. Please have a look at the previous attached zip file (not the first one) and try drag zooming on the second chart. You'll notice the second chart will zoom on both X and Y-Axis but no visual drag box is displayed and the first chart will zoom only on the X-Axis. Functionally this is what I want but I'm not getting the visual drag box on the second chart. Drag zoom on the first chart and it works just as I wanted.
  • You must to post comments
0
0

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?

  • johnnyp112
    Perfect! That is exactly what I wanted. Thanks Yuriy! You guys are great!
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies