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

io.github.mmm.ui.tvm.widget.chart.js.ChartDataset 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;

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

  @JSProperty
  public abstract String getLabel();

  @JSProperty
  public abstract void setLabel(String label);

  @JSProperty
  public abstract String[] getBackgroundColor();

  @JSProperty
  public abstract void setBackgroundColor(String[] backgroundColor);

  @JSProperty
  public abstract float[] getData();

  @JSProperty
  public abstract void setData(float[] data);

  @JSBody(params = { "label", "data" }, script = "return {label:label,data:data};")
  public static native ChartDataset of(String label, float[] data);

  @JSBody(params = { "label", "data", "color" }, script = "return {label:label,data:data,backgroundColor:color};")
  public static native ChartDataset of(String label, float[] data, String color);

  @JSBody(params = { "label", "data", "color", "fill" }, //
      script = "return {label:label,data:data,backgroundColor:color,fill:fill};")
  public static native ChartDataset of(String label, ChartPoint[] data, String color, boolean fill);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy