PyBlade/ui
Menu⌄
DocsComponentsChart

Chart

Bar, line and area charts in SVG, themed with --chart-1 to --chart-5, with a tooltip.

Alpine.js1 file

Installation

pyblade-ui add chart

Usage

The tag <pb-ui.chart> is available in all your templates.

<pb-ui.chart type="bar" x="month" :height="240"
  :series="[{'key': 'desktop', 'label': 'Desktop'}, {'key': 'mobile', 'label': 'Mobile'}]"
  :data="[{'month': 'Jan', 'desktop': 186, 'mobile': 80}, {'month': 'Feb', 'desktop': 305, 'mobile': 200}]" />

Examples

Line

Area

Props

PropDefault
data
x'label'
series
type'bar'
height240
legendTrue
gridTrue
locale'en-US'

Any other attribute (class, id, x-on:click, hx-post…) is passed to the root element; your Tailwind classes win over the component's.