1.2.0 • Published 5 years ago

chartjs-node-plugin-colorschemes v1.2.0

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

chartjs-node-plugin-colorschemes

This is a nodejs compatible fork of chartjs-plugin-colorschemes, which basically just converts the ES6 modules to CommonJS modules, and changes the API somewhat, so that it can be used server-side with packages like chartjs-node.

Usage

To register the plugin to chartjs-node, use the following:

const colorschemes = require('chartjs-node-plugin-colorschemes');

const chart = new ChartjsNode(parsed.dimensions.width, parsed.dimensions.height);

chart.on('beforeDraw', (instance) => {
    colorschemes(instance);
});

You can then pass the desired color scheme in the chartjs configuration like so:

{
    "options": {
        "plugins": {
            "colorschemes": {
                "scheme": "brewer.Spectral11"
            }
        }
    }
}

See the chartjs-plugin-colorschemes website for more usage information and a list of available color schemes.

License

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

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.3.0

5 years ago