ChartTooltip.fromJson constructor
ChartTooltip.fromJson(
- Object? raw
Implementation
factory ChartTooltip.fromJson(Object? raw) {
if (raw is ChartTooltip) return raw;
final json = JsonValue.map(raw) ?? const <String, dynamic>{};
return ChartTooltip(
show: JsonValue.boolOrNull(json['show']) ?? true,
trigger: _parseTooltipTrigger(json['trigger']),
axisPointer: json['axisPointer'] != null
? AxisPointer.fromJson(json['axisPointer'])
: null,
formatter: JsonValue.string(json['formatter']),
showDelay: JsonValue.doubleOrNull(json['showDelay']),
hideDelay: JsonValue.doubleOrNull(json['hideDelay']),
transitionDuration: JsonValue.doubleOrNull(json['transitionDuration']),
enterable: JsonValue.boolOrNull(json['enterable']),
confine: JsonValue.boolOrNull(json['confine']),
renderMode: _parseTooltipRenderMode(json['renderMode']),
backgroundColor: JsonValue.string(json['backgroundColor']),
borderColor: JsonValue.string(json['borderColor']),
borderWidth: JsonValue.doubleOrNull(json['borderWidth']),
borderRadius: JsonValue.doubleOrNull(json['borderRadius']),
padding: JsonValue.doubleOrNull(json['padding']),
textStyle: json['textStyle'] != null
? ChartTextStyle.fromJson(json['textStyle'])
: null,
extraCssText: JsonValue.string(json['extraCssText']),
textColor: JsonValue.string(json['textColor']) ?? 'black',
precision: JsonValue.intOrNull(json['precision']),
fontSize: JsonValue.doubleOrNull(json['fontSize']),
);
}