How to use the plottable.Components.Group 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 / LineChart / LineChart.tsx View on Github external
private createGridlines(chartTable: Table, config: Partial<ChartConfig>) {
    if (config.gridlines) {
      const { showXGrid, showYGrid } = config.gridlines;
      if (showXGrid || showYGrid) {
        const gridlines = new Components.Gridlines(showXGrid ? this.xScale : null, showYGrid ? this.yScale : null);
        if (chartTable.has(this.plot)) {
          chartTable.remove(this.plot);
          const group = new Components.Group([ this.plot, gridlines ]);
          chartTable.add(group, 1, 2);
        } else {
          chartTable.add(gridlines, 1, 2);
        }
      }
    }
  }
github devinit / datahub / src / components / organisms / Charts / components / BarChart / BarChart.tsx View on Github external
private createGridlines(chartTable: Table, config: Partial<ChartConfig>) {
    if (config.gridlines) {
      const { showXGrid, showYGrid } = config.gridlines;
      if (showXGrid || showYGrid) {
        const gridlines = new Components.Gridlines(showXGrid ? this.xScale : null, showYGrid ? this.yScale : null);
        if (chartTable.has(this.plot)) {
          chartTable.remove(this.plot);
          const group = new Components.Group([ this.plot, gridlines ]);
          chartTable.add(group, 1, 2);
        } else {
          chartTable.add(gridlines, 1, 2);
        }
      }
    }
  }