This is my drawing code to draw a custom line with mouse onto a Chart. Can you please help me to do it proper way ?
namespace Grafi
{
public p
You need to store your line somewhere.
The steps you need to take are:
ArrayList>
- where each ArrayList
contains the list of points in one line.new ArrayList
) at the end of the list of linespaint
, iterate through all lines, and draw each point of each line in the array.If you don't store your lines somewhere, they will be lost. Does this make sense?
The other way of storing lines is by using a Canvas
object, where the pixel-map of what is drawn is remembered and automatically drawn. If you don't mind not having your line data as vector points, and you might also want to use images or colours, then this might be a better approach.