Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chartjs-chart-treemap

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chartjs-chart-treemap

Chart.js module for creating treemap charts

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11K
decreased by-20.19%
Maintainers
1
Weekly downloads
 
Created
Source

chartjs-chart-treemap

Chart.js module for creating treemap charts

npm release travis npm bundle size GitHub

Documentation

To create a treemap chart, include chartjs-chart-treemap.js after chart.js and then create the chart by setting the type attribute to 'treemap'

new Chart(ctx, {
    type: 'treemap',
    data: dataObject
});

Configuration

TreeMap chart allows configuration of width and height of the data points in addition to standard Chart.js configuration.

new Chart(ctx, {
    type: 'treemap',
    data: {
        datasets: [{
            label: 'Basic treemap',
            data: [6,6,5,4,3,2,2,1],
            backgroundColor: function(ctx) {
                var value = ctx.dataset.data[ctx.dataIndex];
                var alpha = (value + 3) / 10;
                return Color('blue').alpha(alpha).rgbString();
            }
        }]
    },
});

Example

Live example @codepen.io

TreeMap Example Image

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 test             // run all tests
> gulp test --watch     // run all tests and watch for changes
> gulp test --coverage  // run all tests and generate code coverage
> gulp lint             // perform code linting
> gulp package          // create an archive with dist files and samples

License

chartjs-chart-treemap is available under the MIT license.

Keywords

FAQs

Package last updated on 14 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc