Graph

A versatile data visualization component that supports bar charts, line charts, and pie charts with customizable styles. Perfect for displaying analytics, trends, and comparative data.

Examples

Quarterly Sales Chart

Tambo Conversations

Loading threads...

Installation

$
npx tambo add graph

Component API

Graph

PropTypeDefaultDescription
titlestring-Chart title displayed above the graph
descriptionstring-Optional description text below the title
type"bar" | "line" | "pie""bar"Type of chart to render
labelsstring[][]Array of labels for the x-axis
datasetsDataset[][]Array of dataset configurations
variant"solid" | "bordered""solid"Visual style of the graph container
size"small" | "medium" | "large""medium"Height of the graph container
showLegendbooleantrueWhether to display the legend
classNamestring-Additional CSS classes for customization

Dataset

PropTypeDefaultDescription
labelstring-Dataset label shown in the legend
datanumber[][]Array of data values
backgroundColorstring | string[]-Background color(s) for data points
borderColorstring-Border color for data points (line charts)
borderWidthnumber1Border width for data points