[SalesForce] Uncaught TypeError: Right-hand side of ‘instanceof’ is not an object throws at /resource/chartjs:6:15548 | Salesforce Lightning and Chart.Js

I am encountering below issue while working with chart.js library in salesforce lightning component . I see the below error when i hover or click on the doughnut chart generated . Any help is greatly appreciated .Thanks!

Uncaught TypeError: Right-hand side of 'instanceof' is not an object throws at /resource/chartjs:6:15548

Component


<aura:component >
    <ltng:require scripts="/resource/chartjs" afterScriptsLoaded="{!c.afterScriptsLoaded}" />   
 <div aura:id="progressDiv" class="progressContent">
<canvas aura:id="canvasChart" width="80" height="90"  />
</div> 

Controller

 var bg = component.find('canvasChart');
 var ctx  = bg.getElement().getContext('2d');

  var config = {
    type: 'doughnut',
    data: {
        datasets: [{
            data: [
                20,
                20,
            ],
            backgroundColor: [
                "#F7464A",
                "#ffffff",

            ],
            label: 'Dataset 1'
        }],
        labels: [
            "RED","GREEN"

        ]
    },
    options: {
        responsive: true,
            cutoutPercentage:80,

        title: {
            display: false,
            text: 'Chart.js Doughnut Chart'
        },
        animation: {
            animateScale: true,
            animateRotate: true
        }
    }
};
var doughnout = new Chart(ctx, config);

Best Answer

The likely fix for this is being prepared for release on or near 10/18. I'd like to verify it before then though to eliminate any cycle time if I am wrong. What specific version of chartjs are you using?

Related Topic