iamsjy17 / Plotta.js

Javascript Functional Graph Library
MIT License
23 stars 5 forks source link

Legend values calculating wrong #35

Closed kupietools closed 2 years ago

kupietools commented 2 years ago

Take a look at this screenshot of your demo:

image

The cos is drawn in the right place, but the legend gives its value as around -22. This is completely wrong. I'm finding that every time I add more than one line, the first one gives incorrect values in the legend.

kupietools commented 2 years ago

I fixed it, might have come up with a pretty kludgy solution but it works. It looks like setting up the legend was changing the underlying table data because you assigned a variable by reference instead of by value. I filed a pull request.

iamsjy17 commented 2 years ago

Thanks for reporting.

I uploaded a pr that solves the problem.

Thank you very much. 👍 👍 👍