decodeEndPointsTimeAxisSpec static method
Decodes the object from a Map-like dynamic structure. This expects the JSON format to be of the following structure:
{
"renderSpec": <RenderSpec<DateTime>>,
"showAxisLine": <bool>,
"tickFormatterSpec": <DateTimeTickFormatterSpec>,
"tickProviderSpec": <DateTimeTickProviderSpec>,
"viewport": <DateTimeExtents>
}
Implementation
static charts.EndPointsTimeAxisSpec? decodeEndPointsTimeAxisSpec(
dynamic map, {
bool validate = true,
}) {
charts.EndPointsTimeAxisSpec? result;
if (map is charts.EndPointsTimeAxisSpec) {
result = map;
} else if (map != null) {
assert(SchemaValidator.validate(
schemaId: '$_baseSchemaUrl/end_points_time_axis_spec',
value: map,
validate: validate,
));
result = charts.EndPointsTimeAxisSpec(
renderSpec: decodeRenderSpec<DateTime>(
map['renderSpec'],
validate: false,
),
showAxisLine: map['showAxisLine'] == null
? null
: JsonClass.parseBool(map['showAxisLine']),
tickFormatterSpec: decodeDateTimeTickFormatterSpec(
map['tickFormatterSpec'],
validate: false,
),
tickProviderSpec: map['tickProviderSpec'],
viewport: decodeDateTimeExtents(
map['viewport'],
validate: false,
),
);
}
return result;
}