DEPRECATED: Chart.js Hierarchical Scale Plugin
Chart.js module for adding a new categorical scale which mimics a hierarchical tree.
DEPRECATION Information
Please note that this project has been archived and is no longer being maintained. There is an active fork https://github.com/sgratzl/chartjs-plugin-hierarchical and we will also contribute our future changes to it.
Install
npm install --save chart.js chartjs-scale-hierarchical
Usage
see Samples on Github
or at this CodePen
Scale
a new scale type hierarchical
.
Styling
The hierarchical
axis scale has the following styling options
interface IHierarchicalScaleOptions {
levelPercentage: number;
padding: number;
hierarchyLabelPosition: 'below'|'above'|null;
hierarchyGroupLabelPosition: 'center'|'first'|'last'|'between-first-and-second',
attributes: {[attribute: string]: any};
}
Data structure
interface ILabelNode {
label: string;
expand?: boolean | 'focus';
children?: ISubLabelNode[];
}
declare type ISubLabelNode = ILabelNode | string;
interface IValueNode<T> {
value: T;
children?: ISubValueNode<T>[];
}
declare type ISubValueNode<T> = IValueNode<T> | T;
Building
npm install
npm run build
This repository is part of the Target Discovery Platform (TDP). For tutorials, API docs, and more information about the build and deployment process, see the documentation page.