Polar & Smith Charts?

Apr 14, 2009 at 8:59 PM
privet!

WPF Dynamic Data Display looks very interesting and I'd like to replace my National Instruments plotting library with it.   Besides normal x-y line charts I also need to create Smith Charts (polar plots).   I sub-classed the National Instruments scatter plot to do so before so I have much of the grid algorithms.

Is it possible to override elements of the DynamicDataDisplay library so as to create polar and <hopefully> Smith type charts?  If so, is this relatively straight forward to do, or will I run into major <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <meta content="Word.Document" name="ProgId" /> <meta content="Microsoft Word 11" name="Generator" /> <meta content="Microsoft Word 11" name="Originator" /> <link href="file:///C:%5CUsers%5Crae2081%5CAppData%5CLocal%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List" /><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--> <style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin-top:6.0pt; margin-right:0in; margin-bottom:0in; margin-left:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; mso-bidi-font-size:10.0pt; font-family:Arial; mso-fareast-font-family:"Times New Roman"; mso-bidi-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style> <!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]-->obstacles?

Thanks,

kcsmith
Editor
Apr 15, 2009 at 10:42 AM
Privet!

Current version of DynamicDataDisplay doesn't has possibility to plot charts in polar coordinates. But the upcoming D3's version has built-in support of polar coordinates, so you'll be able to use it in several days.
But it doesn't have support for axes in polar coordinates (when one axis is for radius and another is for polar angle), though we have such axes in plans.
It is a little more difficult with Smith charts - for example, I didn't know about their existance before today, when you've mensioned them. And as I have understood from some pictures I've googled, Smith charts are rather complicated. So when I have free time, I can try to create such chart, but I need more info about its structure, meaning and usage. If you can provide some descriptive materials, I can make a try for you, but this can happen not in the very nearest future (for example, not in next 2-3 weeks).

If you have some extra questions about D3, fell yourself free to ask them.

By the way, if you know Russian (it seems to me that you do), you can contact me in russian at my mail: thecentury+d3@gmail.com

Yours,
Mikhail Brinchuk,
DynamicDataDisplay Dev Team.
Apr 15, 2009 at 8:57 PM
<style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin-top:6.0pt; margin-right:0in; margin-bottom:0in; margin-left:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; mso-bidi-font-size:10.0pt; font-family:Arial; mso-fareast-font-family:"Times New Roman"; mso-bidi-font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline; text-underline:single;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style>

Mikhail:

 

My Russian is terrible, so if you don't mind I'd like to keep this in English.

 

A Smith Chart is nothing more than a polar chart with an impedance grid laid down in the background.   In my prior code I plotted the impedance grid first and then my data in standard polar coordinates.   Then center of the Smith chart is (0,0) while the outer radius may exceed 1.0 (data showing gain).

Here some (poorly documented) code in C++ for the impedance grid

========================================================

for (r = 0.1; r <= radius; r +=0.1)

      {

            cx = 1 - r;

            cy = 0;

            for (aIndex = 0; aIndex < numOfAngles; aIndex++)

            {

                  ang = aIndex*angInc;

                  x[pIndex] = cx + r * System::Math::Cos(ang);

                  y[pIndex] = cy + r * System::Math::Sin(ang);

                  pIndex++;

 

            }

      }

 

      double dx, dy, D,t1, t2, rang, tinc;

 

      for (rang = 10; rang < 360; rang +=10)

      {

            if (rang == 180)

            {

                  x[pIndex] = -radius;

                  y[pIndex] = 0;

                  pIndex++;

 

                  x[pIndex] = radius;

                  y[pIndex] = 0;

                  pIndex++;

            }

            else

            {

                  cx = 1;

                  dx = System::Math::Cos(System::Math::PI*rang/180)-1;

                  dy = System::Math::Sin(System::Math::PI*rang/180);

                  D = System::Math::Sqrt(dx*dx + dy*dy);

                  t2 = (System::Math::PI/2) - System::Math::Asin(dy/D);

                  r = D/(2*System::Math::Cos(t2));

                  cy = r;

                  t1 = System::Math::PI - 2*t2;

                  tinc = t1 / (numOfAngles-1);

 

                  for (aIndex = 0; aIndex < numOfAngles; aIndex++)

                  {

                        ang = -(aIndex*tinc + System::Math::PI/2);

                        x[pIndex] = cx + r * System::Math::Cos(ang);

                        y[pIndex] = cy + r * System::Math::Sin(ang);

                        pIndex++;

                  }

 

                  if (rang > 270)

                  {

                        t1 = System::Math::Asin(dy/radius);

                        tinc = -t1 / (numOfAngles-1);

                  }

                  else if (rang > 180)

                  {

                        t1 = System::Math::PI - System::Math::Asin(dy/radius);

                        tinc = -t1 / (numOfAngles-1);

                  }

                  else if (rang > 90)

                  {

                        t1 = System::Math::PI - System::Math::Asin(dy/radius);

                        tinc = t1 / (numOfAngles-1);

                  }

                  else

                  {

                        t1 = System::Math::Asin(dy/radius);

                        tinc = t1 / (numOfAngles-1);

                  }

 

                  tinc = t1 / (numOfAngles-1);

 

                  for (aIndex = 0; aIndex < numOfAngles; aIndex++)

                  {

                        ang = t1 -aIndex*tinc;

                        x[pIndex] = radius * System::Math::Cos(ang);

                        y[pIndex] = radius * System::Math::Sin(ang);

                        pIndex++;

                  }

 

            }

I also use polar charts for Antenna data.  Antenna charts have a polar grid: angular-radial and the center of the chart may not be zero.  A typical Antenna chart may have -40 at the center and +5 at the outermost radius.   It is useful to be able to rotate the angular 0 degree reference to any position (or at least the top, left, right or bottom of the chart).

 

Here's a reference on Smith Charts:

http://www.sss-mag.com/smith.html

 Here's some open source code for Antenna polar plots:

http://sourceforge.net/projects/ardp/

Spasiba!

Keith Smith

Editor
Apr 16, 2009 at 9:30 AM
Hi Keith,

Thank you for links and description you've wrote, I'll try to create such chart type but a little bit later - maybe in 2-3 weeks.

Pozhaluysta!) (This is "you are welcome" in Russian :) )

Yours,
Mikhail Brinchuk.
Jun 13, 2015 at 4:26 AM
Hello,

I've got a Windows Forms application that displays weather data using the Windows Forms Chart control.

One of the charts is a polar chart for displaying the wind direction. The X-Axis is wind direction (compass angle as double), and the Y-Axis is DateTime.

I also re-labelled the X-Axis to show N, NE, E, SE, etc. at the associated compass angles.

A year's worth of records at 15 minute intervals is... largish and slow to load. The Chart control is also prone to getting itself irretrievably 'in a knot', with a big red cross across it.

Therefore, I've been looking for faster charting. I came across D3.

D3 is certainly faster. A full year's data loads in a fraction of the time it did with the Windows Form Chart control.

I've started with the WPF version, as I don't really want to rely on Silverlight to be installed.

Based on this post, I gather a polar chart should be possible by now, but I can't for the life of me find an example of how to create and configure one.

Can I do it in 'plain old' WPF, or can I only do it in an application for Silverlight?