switchChartTypeForSeriesShapeAuto function
Automatically switches source to the highest-ranked compatible chart
type for its inferred data shape.
Implementation
Map<String, dynamic> switchChartTypeForSeriesShapeAuto(
Map<String, dynamic> source, {
List<ChartType>? preferredOrder,
bool includeCurrentType = false,
bool registeredOnly = true,
}) {
final result = trySwitchChartTypeForSeriesShapeAuto(
source,
preferredOrder: preferredOrder,
includeCurrentType: includeCurrentType,
registeredOnly: registeredOnly,
);
if (!result.success || result.payload == null) {
throw StateError(result.message);
}
return result.payload!;
}