First you need to define the data structure for your chart (for example, you define a Line with the properties start (dot), end (dot), width and color )
Then you need to create a user interface to display the Line inside the Canvas (group container). Ui is responsible for providing interactions such as resizing, color changing, etc. It can display many Line instances according to their properties ( start , end , width and color )
Now your copy and paste is simple.
Simply duplicate the selected Line instance and let the user interface know about it to duplicate the instance.
source share