fromJson static method

ChartDataset? fromJson(
  1. Map<String, dynamic> json
)

Null when data is missing or not entirely numeric — a series the client cannot plot is skipped, never plotted as zeros.

Implementation

static ChartDataset? fromJson(Map<String, dynamic> json) {
  final data = _numbers(json['data']);
  if (data == null) return null;

  return ChartDataset(
    label: json['label'] is String ? json['label'] as String : null,
    data: data,
  );
}