I am using following code to set global options in Chart.js
Chart.defaults.global = {
animationSteps: 30,
tooltipCornerRadius: 0
}
var ctx = document.getElementById("canvas").getContext("2d");
var LChart = new Chart(ctx).Line(data, {
});
It however gives me error
TypeError: fn is not a function
on line 499 in Chart.js
How can I resolve this issue?
Instead of doing this
Chart.defaults.global = {
animationSteps: 30,
tooltipCornerRadius: 0
}
you should do this
Chart.defaults.global.animationSteps = 30;
Chart.defaults.global.tooltipCornerRadius = 0;
When you do the former, you are wiping out all the default values by putting in an entirely new global object (instead of just changing the properties you want to). The only way to get that to work would be define each and every property.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With