Skip to content
Extension chart for Chart.js for rendering nested or segmented pie charts.
HTML JavaScript
Find file
Latest commit a1f2099 @tarnfeld Merge pull request #1 from BrunoDeBarros/patch-1
Respect showTooltips.
Failed to load latest commit information.
demo Responsive example
.gitignore Updated gitignore
MultiLevelPieChart.js Respect showTooltips.
README.md Added some more docs to the readme
bower.json v0.1.2

README.md

MultiLevelPieChart.js

Extension chart for Chart.js for rendering nested or segmented pie charts. This is a useful graphic for rendering tree-like structures, for example disk usage on a file system. View a demo.

Example MultiLevelPieChart

Installing

You can install the extension using Bower with the following command.

$ bower install multilevelpiechart

Example

The source of the demo serves as a good example of how you might use the chart, though here's some sample code to demonstrate how to instantiate one of these pie charts.

(function(){
    var canvas = document.getElementById('demo'),
        ctx = canvas.getContext('2d');

    new Chart(ctx).MultiLevelPie([
        {
            label: "Foo",
            value: 10,
            children: [
                {
                    label: "A",
                    value: 4,
                    children: []
                },
                {
                    label: "B",
                    value: 6,
                    children: []
                }
            ]
        }
    ]);
}).call(this)
Something went wrong with that request. Please try again.