trading-peter / chart-elements

Chart.js as Polymer Elements
https://robdodson.github.io/chart-elements
267 stars 70 forks source link

animation disable #62

Closed ruckc closed 7 years ago

ruckc commented 7 years ago

I've tried everything I can to pass {animation: false} in the options attribute, and {animation: { duration: 0 }}, but it keeps being animated on open or upon refresh of data.

tograd commented 7 years ago

Had to google a bit to find precise syntax:

<chart-bar options='{"animation": false}'></chart-bar>

src: http://stackoverflow.com/questions/7410348/how-to-set-json-format-to-html5-data-attributes-in-the-jquery

ruckc commented 7 years ago

That is very oddly specific in syntax, and it works. Reversing the quotations around doesn't work and seems counter-intuitive. I don't understand how either of the below doesn't work.

<chart-bar options="{animation: false}"></chart-bar>
<chart-bar options="{'animation': false}"></chart-bar>
robdodson commented 7 years ago

Reversing the quotes won't work because Polymer runs JSON.parse when you pass in an object as an attribute. But single quotes are not allowed in JSON

On Tue, Dec 27, 2016 at 5:07 AM, Curtis Ruck notifications@github.com wrote:

That is very oddly specific in syntax, and it works. Reversing the quotations around doesn't work and seems counter-intuitive. I don't understand how either of the below doesn't work.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/robdodson/chart-elements/issues/62#issuecomment-269323606, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBFDdiQddNMLYHVxSLy03VUWaTtpbwVks5rMQ13gaJpZM4LTCDk .