ico icon indicating copy to clipboard operation
ico copied to clipboard

Line graph from example should be a straight line?

Open aled opened this issue 13 years ago • 2 comments

I created a graph from the examples, like this:

new Ico.LineGraph(document.getElementById('chart_1'), [1, 2, 3, 4], { grid: true });

However the line that is drawn isn't straight - screenshot here: http://imgur.com/mYfXE

Aled.

aled avatar Sep 19 '11 22:09 aled

It's drawing it with the curved lines I think, try this:

  new Ico.LineGraph(document.getElementById('bargraph'), [1, 2, 3, 4], { grid: true, curve_amount: 0 });

alexyoung avatar Sep 20 '11 11:09 alexyoung

Alex, I have created a new test case in https://github.com/uiteoi/ico that shows this issue fixed. You can see the above test case at the bottom of: http://reverserisk.com/ico/

I have entirely redesigned the Béziers curve calculation (handles) to avoid all sorts of issues that used to show unnatural curves. This straight line test case emphasizes one of these issues.

You can get the code from line 694 at https://github.com/uiteoi/ico/blob/master/ico.js

I hope this helps, Jean.

uiteoi avatar Sep 21 '11 16:09 uiteoi