-
Notifications
You must be signed in to change notification settings - Fork 0
line
XING Yun edited this page Mar 27, 2018
·
2 revisions
import { line } 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: {
x: { accessor: 'age', type: 'number', name: 'Age' },
y: [ { accessor: 'income', type: 'number', name: 'Monthly Income' } ]
},
};
const fakeData = [
{ age: 19, income: 9 }
]
const _chart = line('#chart', options);
_chart.render(fakeData);
Default options:
{
chart: {
type: 'line',
},
plots: {
curve: 'linear',
strokeWidth: 3,
nodeRadius: 4,
areaOpacity: 1,
drawArea: false,
showDots: true
}
}
Area opacity, 1 by default
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 area?
Draw node or not