Skip to content

iximiuz/cancharts

gh-pages
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

Lightweight Sunburst Chart via HTML5 canvas and Javascript

Example on github.io.

It renders typical daily time distribution presented by data like this:

{
    name: 'day',
    value: 24 * 60 * 60,
    children: [
        {
            name: 'work',
            value: 9 * 60 * 60,
            children: [
                {
                    name: 'coding',
                    value: 6 * 60 * 60,
                    children: [
                        {name: 'python', value: 4 * 60 * 60},
                        {name: 'js', value: 2 * 60 * 60}
                    ]
                },
                {name: 'communicate', value: 1.5 * 60 * 60}
            ]
        },
        {name: 'sleep', value: 7 * 60 * 60},
        ...
};

Usage

var sunburst = new Sunburst(document.getElementById('canvas'), data, options);
sunburst.render();

It is possible to zoom in/zoom out chart parts clicking by sections. Also mouse hover available and has two modes: separate nodes and path.

Options:

onHover    - callback called on mouse hover.
onRender   - callback called on every chart render.
hoverPath  - bool flag for hover mode.
widthScale - scale for width of every continuous node level. Default value is 1.62.

About

Lightweight HTML5 canvas charts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published