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

tech.tablesaw.plotly.api.Histogram Maven / Gradle / Ivy

There is a newer version: 0.43.1
Show newest version
package tech.tablesaw.plotly.api;

import tech.tablesaw.api.NumberColumn;
import tech.tablesaw.api.Table;
import tech.tablesaw.plotly.components.Figure;
import tech.tablesaw.plotly.components.Layout;
import tech.tablesaw.plotly.traces.HistogramTrace;

public class Histogram {

    public static Figure create(String title, NumberColumn data) {
        return create(title, data.asDoubleArray());
    }

    public static Figure create(String title, Table table, String numericColumnName) {
        return create(title, table.numberColumn(numericColumnName));
    }

    public static Figure create(String title, double[] data) {
        HistogramTrace trace = HistogramTrace.builder(data).build();
        return new Figure(Layout.builder(title).build(), trace);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy