use of tech.tablesaw.plotly.components.Figure in project tablesaw by jtablesaw.
the class Scatter3DPlot method create.
public static Figure create(String title, Table table, String xCol, String yCol, String zCol, String sizeColumn, String groupCol) {
TableSliceGroup tables = table.splitOn(table.categoricalColumn(groupCol));
Layout layout = standardLayout(title, xCol, yCol, zCol, false);
Scatter3DTrace[] traces = new Scatter3DTrace[tables.size()];
for (int i = 0; i < tables.size(); i++) {
List<Table> tableList = tables.asTableList();
Marker marker = Marker.builder().size(tableList.get(i).numberColumn(sizeColumn)).build();
traces[i] = Scatter3DTrace.builder(tableList.get(i).numberColumn(xCol), tableList.get(i).numberColumn(yCol), tableList.get(i).numberColumn(zCol)).marker(marker).showLegend(true).name(tableList.get(i).name()).build();
}
return new Figure(layout, traces);
}
use of tech.tablesaw.plotly.components.Figure in project tablesaw by jtablesaw.
the class TimeSeriesPlot method create.
public static Figure create(String title, String xTitle, InstantColumn xCol, String yTitle, NumericColumn<?> yCol) {
Layout layout = Layout.builder(title, xTitle, yTitle).build();
ScatterTrace trace = ScatterTrace.builder(xCol, yCol).mode(ScatterTrace.Mode.LINE).build();
return new Figure(layout, trace);
}
use of tech.tablesaw.plotly.components.Figure in project tablesaw by jtablesaw.
the class TimeSeriesPlot method create.
public static Figure create(String title, String xTitle, DateTimeColumn xCol, String yTitle, NumericColumn<?> yCol) {
Layout layout = Layout.builder(title, xTitle, yTitle).build();
ScatterTrace trace = ScatterTrace.builder(xCol, yCol).mode(ScatterTrace.Mode.LINE).build();
return new Figure(layout, trace);
}
use of tech.tablesaw.plotly.components.Figure in project tablesaw by jtablesaw.
the class TimeSeriesPlot method createDateTimeSeries.
/**
* Creates a time series where the x values are from a DateTimeColumn, rather than a DateColumn
*
* @param title The title of the plot
* @param table The table containing the source data
* @param dateTimeColumnName The name of a DateTimeColumn
* @param numberColumnName The name of a NumberColumn
* @return The figure to be displayed
*/
public static Figure createDateTimeSeries(String title, Table table, String dateTimeColumnName, String numberColumnName) {
DateTimeColumn xCol = table.dateTimeColumn(dateTimeColumnName);
NumericColumn<?> yCol = table.numberColumn(numberColumnName);
Layout layout = Layout.builder(title, xCol.name(), yCol.name()).build();
ScatterTrace trace = ScatterTrace.builder(xCol, yCol).mode(ScatterTrace.Mode.LINE).build();
return new Figure(layout, trace);
}
use of tech.tablesaw.plotly.components.Figure in project tablesaw by jtablesaw.
the class TimeSeriesPlot method create.
public static Figure create(String title, String xTitle, DateColumn xCol, String yTitle, NumericColumn<?> yCol) {
Layout layout = Layout.builder(title, xTitle, yTitle).build();
ScatterTrace trace = ScatterTrace.builder(xCol, yCol).mode(ScatterTrace.Mode.LINE).build();
return new Figure(layout, trace);
}
Aggregations