GraphXSpec.fromJson constructor
GraphXSpec.fromJson(
- Json j
Implementation
factory GraphXSpec.fromJson(Json j) => GraphXSpec(
grid: _b(j['grid'], true),
scale: _s(j['scale'], 'index'),
field: _s(j['field'], ''),
min: _dn(j['min']),
max: _dn(j['max']),
tickValues: GraphTick.list(j['tickValues']),
label: _s(j['label'], 't'),
format: _s(j['format'], 'MMM d'),
barSpacing: _d(j['barSpacing'], 8),
minBarSpacing: _d(j['minBarSpacing'], 0.5),
maxBarSpacing: _d(j['maxBarSpacing'], 80),
rightOffset: _d(j['rightOffset'], 3),
follow: _s(j['follow'], 'end'),
clamp: _b(j['clamp'], true),
overscroll: _b(j['overscroll'], false),
axisHeight: _d(j['axisHeight'], 24),
labels: _b(j['labels'], true),
historyThreshold: _d(j['historyThreshold'], 10),
moreHistory: _b(j['moreHistory'], true),
fit: _s(j['fit'], 'none'),
slots: j['slots'] is int ? j['slots']! as int : null,
tickEvery: j['tickEvery'] is int ? j['tickEvery']! as int : null,
maxBarWidth: _dn(j['maxBarWidth']),
ticks: _s(j['ticks'], 'step'),
morph: _d(j['morph'], 0),
bands: [for (final b in _l(j['bands'])) GraphBandSpec.fromJson(_m(b))],
inset: _d(j['inset'], 0),
);