All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.mmm.ui.tvm.widget.chart.js.Chart Maven / Gradle / Ivy

There is a newer version: 0.9.10
Show newest version
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
 * http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.ui.tvm.widget.chart.js;

import org.teavm.jso.JSBody;
import org.teavm.jso.JSObject;
import org.teavm.jso.JSProperty;
import org.teavm.jso.dom.html.HTMLCanvasElement;

/**
 * {@link JSObject} to wrap {@code Chart} from {@code Chart.js}.
 */
@SuppressWarnings("javadoc")
public abstract class Chart implements JSObject {

  @JSProperty
  public abstract String getType();

  @JSProperty
  public abstract void setType(String type);

  @JSProperty
  public abstract ChartConfig getConfig();

  @JSProperty
  public abstract void setConfig(ChartConfig config);

  public abstract void update();

  @JSBody(params = { "canvas", "config" }, script = "return new Chart(canvas.getContext('2d'), config);")
  public static native Chart of(HTMLCanvasElement canvas, ChartConfig config);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy