Page 1 of 1

Polar series

Posted: Mon Feb 16, 2009 5:03 am
by 13051032
1. I have Steema.TeeChart.Styles.Polar series and i am wondering what is the order of populating the series. I am wondering what is the order of populating the series.

is the following code correct?

Code: Select all

dim myPolar as new Steema.TeeChart.Styles.Polar

myPolar.add(myAngle, myRadius)
My question is myPolar.add(myAngle, myRadius) or myPolar.add(myRadius, myAngle)?

2. I need to access the above series (of type Steema.TeeChart.Styles.Polar) based on point number. I tried to access as follows.

myX = myPolar.Item(myPointNumber).X
myY = myPolar.Item(myPointNumber).Y

The above way of access is giving wrong values. I do not know if this is the right way of doing it. All i need is to get is the X,Y value at the point number. Please suggest something

Posted: Mon Feb 16, 2009 11:18 am
by 10050769
Hi asupriya,
My question is myPolar.add(myAngle, myRadius) or myPolar.add(myRadius, myAngle)?
When you add values in Polar series always puts first value angle and then value radius , so your code is correct when you are using myPolar.add(myAngle,myRadius).
2. I need to access the above series (of type Steema.TeeChart.Styles.Polar) based on point number. I tried to access as follows.
I recomended that you use XValues and YValues as for exemple:

Code: Select all

        myAngle = myPolar.XValues(0)
        myRadius = myPolar.YValues(0)

Posted: Mon Feb 16, 2009 2:02 pm
by 13051032
Thanks. But, still i am not getting the correct values.

For example, at point# 148, i feed the series as X= 86.5223934439536 and Y=671.687960094111; But when i get X = 293.57196714915597 and Y = 666.7910491286284

I am getting these values as

myX = myPolar.XValues(148)
myY = myPolar.YValues(148)

Posted: Mon Feb 16, 2009 2:45 pm
by narcis
Hi asupriya,

Notice that series indexes go from 0 to Series.Count-1. Therefore, to get the 148th point you need to use myPolar.XValues(147).

Posted: Mon Feb 16, 2009 9:24 pm
by 13051032
It seems that the polarseries.XValues and Y values are sorted by the angle and thats why i am not getting the correct values at the point numbers. Please see below and suggest what I should do to get the correct X, Y values

Original Data (format: pointNumber, Angle, Radius) Fed to the series
0, 94.3397294086504, 669.885032955879
1, 92.5803229309372, 671.323047463525
2, 90.244226055005, 673.135195953333
3, 87.6419978143848, 669.487712814105
4, 85.655112286161, 671.616132062456
5, 83.7030693894012, 671.441473729933
6, 82.1567442746308, 670.024164944736
7, 80.0814377656614, 667.419309978234
8, 78.0233807483206, 667.380247752663
9, 76.1190940312841, 667.369090613031


Code generated the following output is:

Code: Select all

Dim mywriter As New StreamWriter("C:\PolarContents.txt")
                            For mm As Integer = 0 To seriesCnt-1
                                mywriter.WriteLine(mm & "," & myPolarSeries.XValues(mm) & "," & myPolarSeries.YValues(mm))
                            Next
                            mywriter.Close()
Print of PolarSeries (format: pointNumber, Angle, Radius)
0,76.1190940312841,667.369090613031
1,78.0233807483206,667.380247752663
2,80.0814377656614,667.419309978234
3,82.1567442746308,670.024164944736
4,83.7030693894012,671.441473729933
5,85.655112286161,671.616132062456
6,87.6419978143848,669.487712814105
7,90.244226055005,673.135195953333
8,92.5803229309372,671.323047463525
9,94.3397294086504,669.885032955879

Simiar output is produced by the following code as well

Code: Select all

Dim mywriter As New StreamWriter("C:\PolarContents.txt")
                            For mm As Integer = 0 To seriesCnt-1
                                mywriter.WriteLine(mm & "," & myPolarSeries.Item(mm).X & "," & myPolarSeries.Item(mm).Y
                            Next
                            mywriter.Close()
I uploaded a project that implements the above scenario. Please provide a solution ASAP. My module is delaying the schedule now and under a ton of pressure. The uploaded file name PolarChart-test-17Feb09.zip. It writes the output from the .XValues and .YValues into a file located at Application.StartUpPath folder (Where the application starts).

Thanks,

Posted: Tue Feb 17, 2009 9:22 am
by 10050769
Hi asupriya,

I think this problem is caused by the order of the series I suggest that use the following code,so you can get the correct value:

Code: Select all

  .XValues.Order = Steema.TeeChart.Styles.ValueListOrder.None
  .YValues.Order = Steema.TeeChart.Styles.ValueListOrder.None

Posted: Wed Feb 18, 2009 6:35 am
by 13051032
Thanks alot. It worked as expected.