ChartLineStyle.fromJson constructor

ChartLineStyle.fromJson(
  1. Object? raw
)

Implementation

factory ChartLineStyle.fromJson(Object? raw) {
  if (raw is ChartLineStyle) return raw;
  final json = JsonValue.map(raw) ?? const <String, dynamic>{};
  return ChartLineStyle(
    color: JsonValue.string(json['color']) ?? 'grey',
    width: JsonValue.doubleOrNull(json['width']) ?? 1.0,
  );
}