[Chartjs]-Chart js, Canvas is null polymer project

1👍

You can get the element in ready method of polymer class so that by the time ready is called, element will be defined and it won’t be null. You can use below code

  class SensorsApp extends Polymer.Element {


    ready(){
    super.ready();
    var ctx = this.shadowRoot.querySelector("#chart").getContext("2d");
    }
    }

Leave a comment