0.1.0 • Published 7 years ago

chartjs-plugin-axispadding v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

axispadding

npm

Chart.js plugin to add axis scale label padding for inner axes. This ensures that axes and scale labels don't touch each other when using multiple axes per side of the chart.

example

Requires Chart.js 2.7.0 or later.

Configuration

To configure this plugin, you can simply add the following entries to your chart options:

NameTypeDefaultDescription
plugins.axispaddingObject/Number{top:6}The axispadding options (see plugins.axispadding.* options). Accepts a padding object or number.

Global options can be change through Chart.defaults.global.plugins.axispadding, which by default will add a half line (6px) of top margin.

For example:

{
    plugins: {
        axispadding: {        // enabled by default
            top: 12,          // add 12px top margin
            bottom: 6,        // add 6px bottom margin
        }
    }
}

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
> gulp package          // create an archive with dist files and samples

License

chartjs-plugin-axispadding is available under the MIT license.

0.1.0

7 years ago