How do I horizontally pan a Smith chart by code?

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
manawyddan
Posts: 3
Joined: Wed Oct 03, 2018 12:20 pm

How do I horizontally pan a Smith chart by code?

Post by manawyddan » Tue Apr 16, 2019 3:39 pm

Hi,
I am using LightningChartUltimate v7 and I am attempting to programmatically zoom and pan a Smith view using the ZoomCenter and ZoomScale properties.
Is it the right way to do that?
I don't understand the ZoomCenter property. Currently, I get its value and turn it into coordinates by using the Axis.ValueToCoord method. Then I update those coordinates with my horizontal delta and set it back as a value to ZoomCenter (using Axis.CoordToValue to do the conversion). When I do that, the graph shifts upwards as well as to the left.
I did not find any useful information in the documentation. How can I do that?

Thanks,
Eric

Arction_LasseP
Posts: 141
Joined: Wed Mar 27, 2019 1:05 pm

Re: How do I horizontally pan a Smith chart by code?

Post by Arction_LasseP » Thu Apr 18, 2019 8:41 am

Hello,

You can pan Smith chart programmatically by changing ZoomCenter as you have done. However, in Smith chart this property is defined in axis coordinates, in other words Real and Imaginary values.
As changing Imaginary value will move chart upwards (or down), only Real value should be updated to achieve the horizontal pan.

Code: Select all

_chart.ViewSmith.ZoomCenter.SetValues(RealValue, ImgValue);
// Change only the RealValue, not ImgValue
Hope this helps. If you have any further questions, feel free to contact our technical support. We are always ready to help.

Russain
Posts: 1
Joined: Tue Apr 23, 2019 8:30 am

Re: How do I horizontally pan a Smith chart by code?

Post by Russain » Wed Apr 24, 2019 10:37 am

Arction_LasseP wrote: Thu Apr 18, 2019 8:41 am Hello,

You can check out lightweight wheelchairs here and pan Smith chart programmatically by changing ZoomCenter as you have done. However, in Smith chart this property is defined in axis coordinates, in other words Real and Imaginary values.
As changing Imaginary value will move chart upwards (or down), only Real value should be updated to achieve the horizontal pan.

Code: Select all

_chart.ViewSmith.ZoomCenter.SetValues(RealValue, ImgValue);
// Change only the RealValue, not ImgValue
Hope this helps. If you have any further questions, feel free to contact our technical support. We are always ready to help.
That's the only difference between the Real and Imaginary values? Vertical and horizontal pan?
Last edited by Russain on Wed Nov 29, 2023 3:37 pm, edited 2 times in total.

Arction_LasseP
Posts: 141
Joined: Wed Mar 27, 2019 1:05 pm

Re: How do I horizontally pan a Smith chart by code?

Post by Arction_LasseP » Thu Apr 25, 2019 12:25 pm

In Smith chart the data is plotted in real and imaginary values (Impedance = R + jX). Since Real values (R) can be seen as horizontal x-axis and Imaginary values (X) vertical y-axis, changing Zoomcenter to a different Real value without changing its Imaginary value causes horizontal pan.

An alternative way to pan horizontally in code is to change ZoomPadding -settings (available in LightningChart v8.4 onwards). ZoomPadding defines the empty space that is left between the chart and its margins after a zooming operation. By changing left or right ZoomPadding -values, panning is possible. A downside of this is that a zooming operation has to be performed each time the padding is changed in order to see the outcome. For example:

Code: Select all

_chart.ViewSmith.ZoomPanOptions.ZoomPadding = new Thickness(10, 30, someChangingValue, 10);
 _chart.ViewSmith.ZoomToLabelsArea();

Post Reply