IndicatorChartConfig.fromJson constructor

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

Implementation

factory IndicatorChartConfig.fromJson(Map<String, dynamic> json) {
  return IndicatorChartConfig(
    value: JsonValue.doubleOrNull(json['value']) ?? 0,
    label: json['label']?.toString() ?? json['title']?.toString() ?? 'KPI',
    previousValue: JsonValue.doubleOrNull(json['previousValue']),
    unit: json['unit']?.toString(),
    precision: JsonValue.intOrNull(json['precision']) ?? 0,
    theme: json['theme'] != null ? ChartTheme.fromJson(json['theme']) : null,
    title: json['title'] != null ? TitlesData.fromJson(json['title']) : null,
  );
}