@makrz,
It seems like the sequence of dataPoints is not proper & CanvasJS doesn’t sort the dataPoints but rendered in the order provided by you. Because of this, you can observe an extra line from the last dataPoint to the first. Sorting dataPoints before passing it to chart-options or storing sorted values in JSON should work fine in this case.
—
Shashi Ranjan
Team CanvasJS