How to use the plottable.Plots.Bar function in plottable

To help you get started, we’ve selected a few plottable examples, based on popular ways it is used in public projects.

github devinit / datahub / src / components / organisms / Charts / components / BarChart / BarChart.tsx View on Github external
private addDatasets(data: DataPoint[]) {
    const groupedData = groupBy(data, datum => datum.series);
    const seriesNames = Object.keys(groupedData);
    const plot = seriesNames.length > 1
      ? new Plots.ClusteredBar()
      : new Plots.Bar();
    seriesNames.forEach(series => plot.addDataset(new Dataset(groupedData[series])));

    return plot;
  }