Page 1 of 1

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

Posted: Fri Oct 28, 2011 3:07 am
by 15360306
which style i can use ? Line, polar ?

it is very urgent!
thanks if someone can help!

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

Posted: Fri Oct 28, 2011 3:23 am
by 15360306
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 9928 times

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

Posted: Fri Oct 28, 2011 7:08 am
by narcis
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);

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

Posted: Fri Oct 28, 2011 7:31 am
by 15360306
thank u very much!