GithubHelp home page GithubHelp logo

shingo-sasaki-0529 / chartjs-adapter-moment Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chartjs/chartjs-adapter-moment

0.0 0.0 0.0 342 KB

License: MIT License

JavaScript 91.70% Shell 8.30%

chartjs-adapter-moment's Introduction

chartjs-adapter-moment

release travis awesome

Overview

This adapter allows the use of Moment.js with Chart.js. Moment.js is a very heavy library and thus not recommended for client-side development. However, it was previously the only library supported by Chart.js and so continues to be supported. You may prefer chartjs-adapter-date-fns for a minimal bundle size or chartjs-adapter-luxon for larger bundle size with additional functionality included such as i18n and time zone support.

Requires Chart.js 2.8.0 or later and Moment.js 2.0.0 or later.

Note: once loaded, this adapter overrides the default date-adapter provided in Chart.js (as a side-effect).

Installation

npm

npm install moment chartjs-adapter-moment --save
import Chart from 'chart.js';
import 'chartjs-adapter-moment';

CDN

By default, https://cdn.jsdelivr.net/npm/chartjs-adapter-moment returns the latest (minified) version, however it's highly recommended to always specify a version in order to avoid breaking changes. This can be achieved by appending @{version} to the URL:

<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>

Read more about jsDelivr versioning on their website.

Configuration

Read the Chart.js documention for possible date/time related options. For example, the time scale time.* options can be overridden using the Moment formats.

Development

You first need to install node dependencies (requires Node.js):

> npm install

The following commands will then be available from the repository root:

> gulp build            // build dist files
> gulp build --watch    // build and watch for changes
> gulp lint             // perform code linting

License

chartjs-adapter-moment is available under the MIT license.

chartjs-adapter-moment's People

Contributors

etimberg avatar benmccann avatar stockinail avatar dependabot[bot] avatar kurkle avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.