Charts Component

Embed interactive charts with bar, line, pie, and other visualization types using the rb-chart web component.


Table of Contents

Overview

The <rb-chart> component renders interactive charts. It supports multiple visualization types including bar, line, pie, doughnut, area, and scatter charts.

ReportBurster Chart Component

FlowKraft Apps: The FlowKraft Frontend App has this component pre-configured. Just paste your embed code from the Usage tab—no script setup required. See FlowKraft Frontend App for details.

Basic Usage

<rb-chart
  report-code="sales-trend"
  api-base-url="http://localhost:9090/api/jobman/reporting"
  style="height: 400px;">
</rb-chart>

Tip: Set a height on the component for consistent sizing.

Attributes

AttributeRequiredDescription
report-codeYesReport folder name configured in ReportBurster
api-base-urlYesBase URL for API calls

DSL Configuration

Chart configuration is defined in ReportBurster using a Groovy DSL.

Chart Types

TypeBest For
barComparing values across categories
lineTime series, trends
piePart-to-whole relationships
doughnutProportions with center content
scatterCorrelations
radarMulti-dimensional comparison

Basic Structure

chart {
    type 'bar'
    labelField 'month'
    
    datasets {
        dataset(field: 'revenue', label: 'Revenue', color: '#3b82f6')
    }
}

Dataset Properties Reference

PropertyDescriptionExample Values
fieldData field for values'sales', 'revenue'
labelLegend label'Monthly Sales'
colorLine/bar color'#3b82f6', 'rgba(59,130,246,0.5)'
backgroundColorFill color'#3b82f6'
borderColorBorder color'#1d4ed8'
typeOverride chart type'line', 'bar'
fillFill area under linetrue, false
tensionLine curve tension0, 0.4
borderWidthLine/border width1, 2
yAxisIDSecondary Y-axis'y1'

Chart Options

chart {
    type 'bar'
    labelField 'month'
    
    datasets {
        dataset(field: 'revenue', label: 'Revenue', color: '#3b82f6')
    }
    
    options {
        responsive true
        plugins {
            title { display true; text 'Monthly Revenue' }
            legend { position 'top' }
        }
    }
}

Examples

Bar Chart with Multiple Series

chart {
    type 'bar'
    labelField 'month'
    
    datasets {
        dataset(field: 'revenue', label: 'Revenue', color: '#3b82f6')
        dataset(field: 'cost', label: 'Cost', color: '#ef4444')
    }
    
    options {
        plugins {
            title { display true; text 'Revenue vs Cost' }
        }
    }
}

Line Chart with Trend

chart {
    type 'line'
    labelField 'date'
    
    datasets {
        dataset(field: 'sales', label: 'Daily Sales', color: '#10b981', tension: 0.3)
    }
}

Combo Chart (Bar + Line)

chart {
    type 'bar'
    labelField 'month'
    
    datasets {
        dataset(field: 'revenue', label: 'Revenue', color: '#3b82f6')
        dataset(field: 'growth', label: 'Growth %', color: '#ef4444', type: 'line', yAxisID: 'y1')
    }
    
    options {
        scales {
            y1 { position 'right'; grid { drawOnChartArea false } }
        }
    }
}