gwatts / jquery.sparkline

A plugin for the jQuery javascript library to generate small sparkline charts directly in the browser
http://omnipotent.net/jquery.sparkline/
1.24k stars 278 forks source link

Sparkline Modifies Input Values in Stacked Bar Charts #191

Open trescenzi opened 7 years ago

trescenzi commented 7 years ago

When working with a stacked bar chart the input array is modified in place thus resulting in the data that's passed in to fail an equality check after the sparkline has been drawn. You can see that in this jsfiddle.

This is causing an issue when coupled with AngularJS's watchCollection as seen here.

The offending line seems to be this one

This is easily averted by simply passing in a copy of the data by calling slice() on it first so this isn't a particularly huge issue.