Hi, I want a funtion graph in android.
I have two arrays (x e y) and want graph with draw line, but throws me
an error "the application has stopped unexpectedly ". I probe drawline
one to one and works


protected void onDraw(Canvas canvas) {
                int [] datx= {30,40,60,80,100};
                int [] daty = {20,60,90,60,100};


/*canvas.drawLine(datx[1],daty[1],datx[2],daty[2]  ,paint);
                canvas.drawLine(datx[2],daty[2],datx[3],daty[3]  ,paint);
                canvas.drawLine(datx[3],daty[3],datx[4],daty[4]  ,paint);
*/

                for(int i=0; i<=daty.length; i++){

                        canvas.drawLine(datx[i],daty[i],datx[i+1],daty[i+1]  
,paint);

                        }



                        }

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to