GraphLegendSpec.fromJson constructor

GraphLegendSpec.fromJson(
  1. Object? v
)

Implementation

factory GraphLegendSpec.fromJson(Object? v) {
  if (v is bool) return GraphLegendSpec(show: v ? 'always' : 'none');
  final j = _m(v);
  final show = j['show'];
  return GraphLegendSpec(
    show: show is bool ? (show ? 'always' : 'none') : _s(show, 'none'),
    position: _s(j['position'], 'auto'),
    values: _b(j['values'], true),
  );
}