Sending data to polar plots

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Mark
Newbie
Newbie
Posts: 12
Joined: Mon Jan 26, 2004 5:00 am
Location: Ellicott City, MD

Sending data to polar plots

Post by Mark » Thu May 27, 2004 3:24 am

Hello,

I cannot seem to get data displayed correctly to a polar plot. Could you please provide an example of how this is accomplished, please do not use the "this.polar1.FillSampleValues(100)" command.

Thank you.

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Thu May 27, 2004 6:47 am

Hi, John.
FillSampleValues(100)
How about this:

Code: Select all

polar1.Clear();
polar1.Add(10,200);  // angle = 10deg, radius = 200
polar1.Add(45,110);  // angle = 45deg, radius = 110
polar1.Add(210,250);  // angle = 210deg, radius = 250
polar1.Add(340,220);  // angle = 340deg, radius = 220
First parameter in Add is associated with angle, second with radius. Hope this helps.
Marjan Slatinek,
http://www.steema.com

Mark
Newbie
Newbie
Posts: 12
Joined: Mon Jan 26, 2004 5:00 am
Location: Ellicott City, MD

Post by Mark » Thu May 27, 2004 1:29 pm

Thank you very much. I was trying to put arrays into the polar plot via the add using the following commands:

this.polar1.Add(angValues, magValues);

where magValues and angValues are arrays that have been give their respective data points. Is there a method to put complete arrays in?

Thanks again for your quick response.

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu May 27, 2004 5:42 pm

Hi John,
points. Is there a method to put complete arrays in?
Yes, just as you did :
this.polar1.Add(angValues, magValues);

Mark
Newbie
Newbie
Posts: 12
Joined: Mon Jan 26, 2004 5:00 am
Location: Ellicott City, MD

Post by Mark » Fri May 28, 2004 1:44 am

Hello,

This is what I understood for adding complete magnitude and angle arrays to the polar plot (this.polar1.Add(angValues, magValues);), but the polar plot does not seem to display the values. Is there some additional commands to make the polar plot display properly?

The following is a larger segment of my code:

this.polar1.Pen.Color = System.Drawing.Color.Cyan;
this.polar1.CirclePen.Visible =false;
this.polar1.ClockWiseLabels = false;
this.polar1.AngleIncrement = 10;
this.polar1.Chart.Axes.Visible = true;
this.polar1.Chart.Axes.Left.AxisPen.Visible = true;
this.polar1.Chart.Axes.Right.AxisPen.Visible = true;
this.polar1.Chart.Axes.Top.AxisPen.Visible = true;
this.polar1.Chart.Axes.Bottom.AxisPen.Visible = true;
this.polar1.Chart.Axes.Left.AxisPen.Width = 2;
this.polar1.Chart.Axes.Right.AxisPen.Width = 2;
this.polar1.Chart.Axes.Top.AxisPen.Width = 2;
this.polar1.Chart.Axes.Bottom.AxisPen.Width = 2;
this.polar1.Chart.Axes.Left.Labels.Visible = false;
this.polar1.Chart.Axes.Right.Labels.Visible = false;
this.polar1.Chart.Axes.Top.Labels.Visible = false;
this.polar1.Chart.Axes.Bottom.Labels.Visible = false;

double[] magValues = new double[10];
double[] angValues = new double[10];
magValues[0] = 150;
magValues[1] = 150;
magValues[2] = 150;
magValues[3] = 150;
magValues[4] = 150;
magValues[5] = 150;
magValues[6] = 150;
magValues[7] = 150;
magValues[8] = 150;
magValues[9] = 150;

angValues[0] = 45;
angValues[1] = 135;
angValues[2] = 225;
angValues[3] = 315;
angValues[4] = 135;
angValues[5] = 45;
angValues[6] = 225;
angValues[7] = 45;
angValues[8] = 315;
angValues[9] = 135;

this.polar1.Add(angValues, magValues);
this.polar1.RefreshSeries();

I have used tChart for the past ~2 years, but this is the first time that I have worked with the polar chart.

Thanks again for your help.

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri May 28, 2004 9:24 am

Hi John,

the problem is in the following line, sorry to not see this before (in your last post) :
this.polar1.Add(angValues, magValues);
that should be :
this.polar1.Add(magValues,angValues);

Mark
Newbie
Newbie
Posts: 12
Joined: Mon Jan 26, 2004 5:00 am
Location: Ellicott City, MD

Thanks!

Post by Mark » Fri May 28, 2004 1:36 pm

Hello,

Thanks you for the help, this worked. I also discovered that to scale a polar chart was not obvious, it took the following commands:

this.tChart1.Axes.Left.Maximum = maxValue;
this.tChart1.Axes.Left.Minimum = minValue;

The confusing part for me was that the Axes.Left perfoms the radius scaling, while the Axes.Bottom performs the angular scaling.

Thanks again for your quick response; have a great weekend!

Post Reply