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: about 1 month 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: 2024-09-01T22:51:41.000Z (4 months ago)
- Last Synced: 2024-09-30T05:28:45.219Z (3 months ago)
- Topics: chartjs, spacetime
- Language: TypeScript
- Homepage:
- Size: 332 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
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).