adapt static method

Map<String, dynamic> adapt(
  1. Map<String, dynamic> json,
  2. ChartType targetType, {
  3. bool force = true,
})

Adapts the json payload to be compatible with targetType.

force defaults to true for backward compatibility with the old adapter: lossy-but-useful conversions such as cartesian -> pie/hierarchy/financial are allowed. Pass force: false to permit only same-shape targets.

Implementation

static Map<String, dynamic> adapt(
  Map<String, dynamic> json,
  ChartType targetType, {
  bool force = true,
}) => registry.switchChartTypeForSeriesShape(
  json,
  targetType: targetType,
  force: force,
);