โ† All libraries

SugarCharts

๐Ÿ“Š SugarCharts

Terminal charts for CandyCore

port of ntcharts charts sparkline heatmap sixel kitty iterm2

Sparkline, Bar, Line, Heatmap, Scatter, TimeSeries, Streamline, Waveline, OHLC, plus inline image rendering via Sixel / Kitty / iTerm2 protocols. Auto-detects terminal capability.

Install

composer require candycore/sugar-charts

Quickstart

use CandyCore\Charts\Sparkline\Sparkline;
use CandyCore\Charts\BarChart\BarChart;
use CandyCore\Charts\LineChart\LineChart;

echo Sparkline::new([1, 3, 2, 8, 5, 4, 7, 6], 8)->view() . PHP_EOL;
// โ–โ–ƒโ–‚โ–ˆโ–…โ–„โ–‡โ–†

echo BarChart::new(
    [['cpu', 0.7], ['mem', 0.4], ['disk', 0.9]], 20, 5
)->view() . PHP_EOL;

echo LineChart::new([1, 4, 2, 8, 6, 3, 7], 30, 6)->view();

What's in the box

CanvasFixed cell grid with rune + Sprinkles Style per cell. Foundation under every chart type.
SparklineSingle-row series via 8 Unicode bar glyphs. Perfect for log dashboards.
Bar / LineAuto-scaling y-axis, configurable axis labels, optional grid.
HeatmapDensity visualisation with palette gradients.
OHLCCandlestick chart for financial time-series.
TimeSeriesStreaming series with bucket aggregation.
Picture (Sixel/Kitty/iTerm2)Inline raster image rendering. Auto-detects via terminal-version query.

Source & demos

Try the quickstart โ†’

Demos.

VHS-recorded GIFs of every example shipped with the library. Regenerated automatically on every push that touches the source.

Sparkline

Sparkline

Single-row series โ€” eight Unicode glyphs.
Bar chart

Bar chart

Auto-scaling labelled vertical bars.
Line chart

Line chart

Single-series ASCII plot with axes.
Heatmap

Heatmap

Density visualisation with palette gradient.
Scatter

Scatter

Cell-quantised XY plot.
TimeSeries

TimeSeries

Streaming series with bucket aggregation.
OHLC

OHLC

Candlestick chart for financial data.
Picture

Picture

Inline image via Sixel / Kitty / iTerm2.