How to use the plottable.Components.Table 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.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github devinit / datahub / src / components / organisms / Charts / components / LineChart / LineChart.tsx View on Github external
private renderChart(chartNode: HTMLDivElement, data: DataPoint[]) {
    const xConfigs = parseXAxisConfigs(data, this.props.config);
    const yConfigs = parseYAxisConfigs(this.props.config);
    const configs = this.getConfigs(this.props.config);

    this.lineChart = new Components.Table();

    this.createAxes(xConfigs, yConfigs, this.lineChart);
    this.setAxisLabel(xConfigs, this.lineChart, 1, 0);

    this.plot = this.addDatasets(data)
      .x(d => d.x, this.xScale)
      .y(d => d.y, this.yScale)
      .animated(true);
    this.lineChart.add(this.plot, 1, 2);
    this.createGridlines(this.lineChart, configs);
    this.createChartLegend(data, this.lineChart, configs.legend);

    setAttributes(this.plot, this.props);
    this.plot.onAnchor(() => this.onAnchor(this.plot, configs));

    if (this.props.onBeforeRender) {
github devinit / datahub / src / components / organisms / Charts / components / BarChart / BarChart.tsx View on Github external
private renderChart(chartNode: HTMLDivElement, data: DataPoint[]) {
    const xConfigs = parseXAxisConfigs(data, this.props.config);
    const yConfigs = parseYAxisConfigs(this.props.config);
    const configs = this.getConfigs(this.props.config);

    this.barChart = new Components.Table();

    this.createAxes(xConfigs, yConfigs, this.barChart);
    this.setAxisLabel(xConfigs, this.barChart, 1, 0);

    this.plot = this.addDatasets(data)
      .x(d => d.x, this.xScale)
      .y(d => d.y, this.yScale)
      .animated(true);
    this.barChart.add(this.plot, 1, 2);
    this.createGridlines(this.barChart, configs);
    this.createChartLegend(data, this.barChart, configs.legend);

    setAttributes(this.plot, this.props);
    this.plot.onAnchor(() => this.onAnchor(this.plot, configs));

    if (this.props.onBeforeRender) {