Add the margin of the diagram.
Fix bugs, can draw the line now.
Add the auto fresh logic
Use Rectangle to draw the background.
Fix the view diagram refresh issue.
Remove some unused code.
Add COS diagram in record view controller.
Fix some bugs.