BulletChartConfig.fromJson constructor
BulletChartConfig.fromJson(
- Map<String, dynamic> json
)
Implementation
factory BulletChartConfig.fromJson(Map<String, dynamic> json) {
final items = ChartSeriesJson.firstSeriesData(
json['series'],
).map(BulletItem.fromJson).toList();
return BulletChartConfig(
items: items,
showLabels: JsonValue.boolOrNull(json['showLabels']) ?? true,
showValues: JsonValue.boolOrNull(json['showValues']) ?? true,
barHeightFraction:
JsonValue.doubleOrNull(json['barHeightFraction']) ?? 0.35,
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,
);
}