-
Notifications
You must be signed in to change notification settings - Fork 0
Bar
XING Yun edited this page Mar 27, 2018
·
5 revisions
import { bar } 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 = bar('#chart', options);
chart.render(fakeData);
Default options:
plots: {
barLabel: {
enabled: false,
color: 'black',
},
metricLabel: {
enabled: false,
color: 'black',
offset: 10,
},
},
enable the dimension label within bars or not.
color of bar label
display metric label on top of bars?
color of metric label
Metric label offset against bar top