μPlot.js – Fast, memory-saving graphic library based on 2D Canvas for quickly mapping time series, lines, areas, and bar charts.
Time series data is a lightweight, interactive, scalable, high-performance chart library to visualize any time a sequence of knowledge factors listed in time order utilizing Canvas API.
Visualize Time Series Data With μPlot Chart Library Details
Post Name | Time Series Data μplot |
Author Name | leeoniya |
Category | Chart & Graphs Plugins |
Official Page | Click Here |
Official Website | github.com |
Publish Date | August 22, 2020 |
Last Update | July 24, 2023 |
Download | Link Below |
License | MIT |
Features
- Multiple series w/toggle
- Multiple y-axes, scales & grids
- The temporal or numeric x-axis
- Linear, uniform, or logarithmic scales
- Line & Area styles (stroke, fill, width, dash)
- Pluggable path renderers linear, spline, stepped, bars
- Zoom with auto-rescale
- Legend with live values
- Support for IANA Time Zone Names & DST
- Support for missing data
- Cursor sync for multiple charts
- Focus on the closest series
- Data streaming (live update)
- High / Low bands
- A lean, consistent, and powerful API with hooks & plugins
Non-Features
In order to stay slim, fast, and focused, the following features will not be added:
- There is no data analysis, aggregation, aggregation, or statistical processing – just do it in advance. For example https://simplestatistics.org/, https://www.papaparse.com/
- No transitions or animations – it’s always pure distractions.
- There is no collision avoidance for axis label labels, so manual tweaking of spacing metrics may be required if label customization greatly increases the default label width.
- There is no built-in drag/pan because of the ambiguous native zoom/select behavior. However, this can be added externally via a plugin/hooks API: zoom-wheel, zoom-touch.
Must Read: Easy Interface Javascript Chart Library Based on D3.js | billboard.js
How to make use of it:
1. Download and import the μPlot library.
<link rel="stylesheet" href="uPlot.css"> <script src="uPlot.iife.min.js"></script>
2. Prepare the time collection data.
const data = [ // x-values (Unix timestamps) [1566458800, 1566452560, 1566460860, 1538464460], // data series 1 [0.54, 0.15, 3.27, 7.51], // data series 2 [12.85, 13.21, 13.65, 14.01], // data series 3 [0.52, 1.25, 0.75, 3.62] ];
3. The instance JS to initialize the μPlot
Library.
let myChart = new uPlot({ // width/height in pixels width: 960, height: 400, // chart title title: "My Chart", // unique chart ID id: "chart1", // additional CSS class(es) class: "my-chart", // determines how to present your data series: [ {}, { // initial toggled state (optional) show: true, spanGaps: false, // in-legend display label: "RAM", value: (self, rawValue) => "$" + rawValue.toFixed(2), // series style stroke: "red", width: 1, fill: "rgba(255, 0, 0, 0.3)", dash: [10, 5], } ], // customize the x, y axis axes: { y: [ { scale: '%', values: (vals, space) => vals.map(v => +v.toFixed(1) + "%"), }, { side: 3, scale: 'mb', values: (vals, space) => vals.map(v => +v.toFixed(2) + "MB"), grid: null, }, ], } }, data, document.body);
4. Default x-axis options.
scale: 'x', space: 40, height: 30, side: 0, class: "x-time", incrs: timeIncrs, values: (vals, space) => { let incr = vals[1] - vals[0]; let stamp = ( incr >= d ? fmtDate('{M}/{D}') : // {M}/{DD}/{YY} should only be prepended at 12a? // {YY} only at year boundaries? incr >= h ? fmtDate('{M}/{DD}\n{h}{aa}') : incr >= m ? fmtDate('{M}/{DD}\n{h}:{mm}{aa}') : fmtDate('{M}/{DD}\n{h}:{mm}:{ss}{aa}') ); return vals.map(val => stamp(new Date(val * 1e3))); }, grid: { color: "#eee", width: 2 }
5. Default y-axis options.
scale: 'y', space: 30, width: 50, side: 1, class: "y-vals", incrs: numIncrs, values: (vals, space) => vals, grid: { color: "#eee", width: 2 }
6. Default options for the time series data on the x-axis.
label: "Time", scale: "x", value: v => stamp(new Date(v * 1e3))
7. Default options for the time series data on the y-axis.
shown: true, label: "Value", scale: "y", value: v => v
See Demo And Download

Official Website(leeoniya): Click Here
This superior jQuery/javascript plugin is developed by leeoniya. For extra Advanced usage, please go to the official website.