Pixel UI/Data/Chart

Chart

Small dithered area, line and bar charts, drawn on the GPU.

<piix-chart>WebGL
Kind
Palette

An area chart's fill fades out in a dither instead of a gradient, with the line on top in the brightest colour; bars are stepped columns shaded from the top. It sweeps in from the left the first time it's on screen. Hover it and a crosshair snaps to the nearest point and shows the label and value.

Installation

<!-- once, anywhere on the page: every component -->
<script src="https://cdn.jsdelivr.net/npm/piixpal@0.6/piixpal.min.js"></script>

Usage

<piix-chart values="12,18,14,24,30,26,38,34,42,48,44,56"
  labels="Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec" suffix="k"></piix-chart>

Examples

Bars

In a stat card

Revenue $48.2k

API reference

AttributeWhat it doesDefault
valuesthe numbers, comma separated (up to 256)–
labelsa label for each–
kindarea line barsarea
suffixafter each value, like % or ms–
minwhere the axis starts0
paletteits colourslime
heightpx or any CSS length220px
pixelsize of one pixel, in px3

Accessibility