how can i draw a ellipse,or a orbit like a irregular circle

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
lwperic
Newbie
Newbie
Posts: 3
Joined: Wed Sep 28, 2011 12:00 am

how can i draw a ellipse,or a orbit like a irregular circle

Post by lwperic » Fri Oct 28, 2011 3:07 am

which style i can use ? Line, polar ?

it is very urgent!
thanks if someone can help!

lwperic
Newbie
Newbie
Posts: 3
Joined: Wed Sep 28, 2011 12:00 am

Re: how can i draw a ellipse,or a orbit like a irregular circle

Post by lwperic » Fri Oct 28, 2011 3:23 am

when i draw a circle by these code:
Line line3 = new Line( myChart2.getChart() );
for(i=0;i<1024;i++)
{
dx = 2* Math.cos( omega*dt*i + Math.PI/2 );

dy = 2* Math.cos( omega*dt*i ) ;// + 4* Math.cos(2*omega*dt*i);

line3.add( dx,dy );
}
i get the result:
circle.JPG
is_not_a _circle
circle.JPG (27.16 KiB) Viewed 1891 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: how can i draw a ellipse,or a orbit like a irregular circle

Post by Narcís » Fri Oct 28, 2011 7:08 am

Hi lwperic,

Line series was designed to plot sequential data and hence X values are sorted ascendingly. To get a circle from this data set you should set X values not being sorted before populating series:

Code: Select all

        line3.getXValues().setOrder(ValueListOrder.NONE);
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

lwperic
Newbie
Newbie
Posts: 3
Joined: Wed Sep 28, 2011 12:00 am

Re: how can i draw a ellipse,or a orbit like a irregular circle

Post by lwperic » Fri Oct 28, 2011 7:31 am

thank u very much!

Post Reply