Search by

donatj / ticker-graph

donatj

This package is abandoned and no longer maintained. No replacement package was suggested.

Simple JavaScript Ticker Graph using the Quorum JS Installer

Package info

github.com/donatj/TickerGraph

Language:JavaScript

Type:quorum-js

pkg:composer/donatj/ticker-graph

Statistics

Installs: 62 470

Dependents: 0

Suggesters: 0

Stars: 3

Open Issues: 1

v0.5.0 2026-11-05 20:39 UTC

This package is auto-updated.

Last update: 2026-11-05 22:22:19 UTC


README

npm version

Simple JavaScript Real Time "Ticker Graph"

Requires no external libraries.

Here are some more examples.

Install

npm install ticker-graph

Features

  • Auto Scales to min and max values.
  • Color set-able per column via callback.
  • Set a color for an individual value when calling push.

Example

To output a simple sine wave like so: Small Ticker Sine Wave Example

<script src="lib/TickerGraph.js"></script>
<canvas id="cv" width="100" height="40"></canvas>
<script>
	const t = new TickerGraph( document.getElementById("cv") );
	let i = 0;
	setInterval(function(){
		t.push( Math.sin(i++ / 10) );
	}, 20);
</script>

Pass a color for a single value with push:

t.push(42, { color: "#f00" });

This color takes precedence over the graph's color or color callback for that value. Other values continue to use the graph's color or callback.

The graph keeps a reference to the options object. You can change its color later. The change appears when the next push redraws the graph. Values that share an options object will all use its updated color.

Get the current values from oldest to newest with getValues. It returns a new array, so changes to the array do not affect the graph.

const values = t.getValues();

Use getLastValue to get the most recently pushed value. It returns null before the first value is pushed.

const lastValue = t.getLastValue();