BoxPlotChartConfig.fromJson constructor

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

Implementation

factory BoxPlotChartConfig.fromJson(Map<String, dynamic> json) {
  final boxData = _parseBoxData(json);
  return BoxPlotChartConfig(
    categories: _categoriesOrFallback(json['categories'], boxData),
    boxData: boxData,
    showMean: JsonValue.boolOrNull(json['showMean']) ?? true,
    showNotch: JsonValue.boolOrNull(json['showNotch']) ?? false,
    boxWidthFraction: JsonValue.doubleOrNull(json['boxWidth']) ?? 0.5,
    title: json['title'] != null ? TitlesData.fromJson(json['title']) : null,
    tooltip: json['tooltip'] != null
        ? ChartTooltip.fromJson(json['tooltip'])
        : null,
    legend: json['legend'] != null
        ? ChartLegend.fromJson(json['legend'])
        : null,
    toolbox: json['toolbox'] != null
        ? ChartToolbox.fromJson(json['toolbox'])
        : null,
    grid: json['grid'] != null ? GridData.fromJson(json['grid']) : null,
  );
}