简体   繁体   中英

How to draw a line graph in Corona SDK

How can I draw a line graph in Corona SDK? I have 3 numbered tables (zero days, benign, malignant) which needs to be plotted in the graph and draw a line connection with the same category.

Can someone show me how it's done?

Thanks

I suggest you to create a series of lines to draw both the graph and the line inside. To create lines use display.newLine where you declare the coordinates of the beginning and the end of the line. Also to draw a line made up of more you can use:append and indicate new coordinates for new points of the line.

local object = display.newLine( 10, 20, 30, 60 )
object:append( 30, 80, 70, 82 )
object:setStrokeColor( 1, 0, 0, 1 )

For further information: Solar2D Documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM