Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nfinished/chartjs-adapter-spacetime
Spacetime adapter for Chart.js
https://github.com/nfinished/chartjs-adapter-spacetime
chartjs spacetime
Last synced: 3 months ago
JSON representation
Spacetime adapter for Chart.js
- Host: GitHub
- URL: https://github.com/nfinished/chartjs-adapter-spacetime
- Owner: Nfinished
- License: mit
- Created: 2022-12-22T16:25:36.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-01T21:59:14.000Z (over 1 year ago)
- Last Synced: 2024-07-05T11:44:18.884Z (4 months ago)
- Topics: chartjs, spacetime
- Language: TypeScript
- Homepage:
- Size: 211 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - spacetime
README
# chartjs-adapter-spacetime
[![npm](https://img.shields.io/npm/v/chartjs-adapter-spacetime?style=flat-square)](https://www.npmjs.com/package/chartjs-adapter-spacetime)
[![npm peer dependency version](https://img.shields.io/npm/dependency-version/chartjs-adapter-spacetime/peer/chart.js?style=flat-square)](https://www.npmjs.com/package/chart.js)
[![npm peer dependency version](https://img.shields.io/npm/dependency-version/chartjs-adapter-spacetime/peer/spacetime?style=flat-square)](https://www.npmjs.com/package/spacetime)## Spacetime support for Chart.js TimeScale plugin.
```bash
$ npm install spacetime chartjs-adapter-spacetime$ yarn add spacetime chartjs-adapter-spacetime
$ pnpm add spacetime chartjs-adapter-spacetime
``````ts
import { Chart as ChartJS, TimeScale } from 'chart.js'import 'chartjs-adapter-spacetime'
ChartJS.register(TimeScale)
```When providing your own formats via [Chart.JS options](https://www.chartjs.org/docs/latest/axes/cartesian/time.html#configuration-options), use Spacetime's [unixFmt options](https://github.com/spencermountain/spacetime/blob/master/src/methods/format/unixFmt.js). Localization is not currently supported.
Some portions of this project are based on [chartjs-adapter-luxon](https://www.github.com/chartjs/chartjs-adapter-luxon).