PyBlade/ui
Menu⌄
DocsComposantsChart

Chart

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

Alpine.js1 fichier

Installation

pyblade-ui add chart

Utilisation

La balise <pb-ui.chart> est disponible dans tous vos 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}]" />

Exemples

Courbe

Aire

Props

PropDéfaut
data
x'label'
series
type'bar'
height240
legendTrue
gridTrue
locale'en-US'

Tout autre attribut (class, id, x-on:click, hx-post…) est transmis à l'élément racine ; vos classes Tailwind l'emportent sur celles du composant.