-
Notifications
You must be signed in to change notification settings - Fork 0
multi line
XING Yun edited this page Mar 27, 2018
·
3 revisions
import { multiLine } from 'vizart-basic';
import 'vizart-basic/dist/vizart-basic.css';
const options = {
chart: {
height: 420,
margin: { left: 30, right: 30, top: 10, bottom: 30 }
},
data: {
s: { name: 'Department', type: 'string', accessor: 'dep'},
x: { name: 'Age', type: 'string', accessor: 'age'},
y: [ { name: 'Monthly Income', type: 'number', accessor: 'income'} ],
},
plots: {
stackLayout: true,
stackMethod: 'zero',
curve: 'natural',
strokeWidth: 2,
opacityArea: 0.7
}
};
const data = [
{ age: 19, income: 9, dep: 'science' }
]
const chart = multiLine('#chart', options);
chart.render(data);Default Options:
const DefaultOptions = {
chart: {
type: 'line_multi',
},
plots: {
curve: 'linear',
highlightNodeColor: '#F03E1E',
strokeWidth: 3,
showDots: false,
dotRadius: 4,
},
};line curves, currently support:
- 'linear'
- 'linear'
- 'linear-closed'
- 'step'
- 'step-before'
- 'step-after'
- 'basis'
- 'basis-open'
- 'basis-closed'
- 'bundle'
- 'cardinal'
- 'cardinal-open'
- 'cardinal-closed'
- 'monotoneX'
- 'monotoneY'
- 'natural'
- 'catmull-rom'
- 'catmull-rom-closed'
- 'catmull-rom-open'
line width, 4 by default
node radius, only take effect when node is displayed
Draw dots or not
Node highlighted color
