Sunday, September 11, 2022

Wrapping Javascript library (chart.js) using JSInterop

Hi All,

Good Day!

I'm new in GWT and I'm going through documentation and JSInterop. I'm facing issues with implementing chart.js using JSInterop. Can anyone guide me on how to resolve and keep things working? I am facing an error - "The import elemental2 cannot be resolved"

code is - 
package chartjs;

import elemental2.dom.HTMLCanvasElement; => facing error on this line
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsType;

@JsType(isNative = true, namespace = JsPackage.GLOBAL)
public class Chart {

    public Chart(HTMLCanvasElement canvasElement, ChartConfiguration configuration) {
    }
}

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/d85e1313-7a55-482f-b712-022cf6fef5acn%40googlegroups.com.

No comments:

Post a Comment