-
Notifications
You must be signed in to change notification settings - Fork 0
scatter
XING Yun edited this page Mar 27, 2018
·
2 revisions
import { scatter } 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' } ]
r: { accessor: 'companyYears', type: 'number', name: 'Years at Company' } //optional
},
};
const fakeData = [
{ age: 19, income: 9, companyYears:5 }
]
const chart = scatter('#chart', options);
chart.render(fakeData);
Default options:
{
chart: {
type: 'scatter',
},
plots: {
blur: false,
opacity: 1,
bubble: {
min: 6,
max: 20,
default: 8
}
},
zAxis: {
allowDecimals: false,
scale: null,
max: 100,
min: 0,
},
data: {
z: {
accessor: null,
type: FieldType.NUMBER,
formatter: null,
},
}
}
Turn on real-life motion blur?
bubble opacity, 1 by default
minimum bubble radius
maximum bubble radius
default bubble radius
Radius field