targetSeriesDataShape function

ChartSeriesDataShape targetSeriesDataShape(
  1. ChartType rawType
)

Returns the expected series-data shape for type.

Implementation

ChartSeriesDataShape targetSeriesDataShape(ChartType rawType) {
  final type = canonicalChartType(rawType);
  if (cartesianTypes.contains(type)) return ChartSeriesDataShape.cartesian;
  if (pieLikeTypes.contains(type)) return ChartSeriesDataShape.pieLike;
  if (hierarchicalTypes.contains(type)) {
    return ChartSeriesDataShape.hierarchical;
  }
  if (matrixTypes.contains(type)) return ChartSeriesDataShape.matrix;
  if (graphTypes.contains(type)) return ChartSeriesDataShape.graph;
  if (flowTypes.contains(type)) return ChartSeriesDataShape.flow;
  if (financialTypes.contains(type)) return ChartSeriesDataShape.financial;
  if (radialTypes.contains(type)) return ChartSeriesDataShape.radial;
  if (calendarTypes.contains(type)) return ChartSeriesDataShape.calendar;
  if (geoTypes.contains(type)) return ChartSeriesDataShape.geospatial;

  switch (type) {
    case ChartType.sparkline:
    case ChartType.boxPlot:
    case ChartType.violin:
    case ChartType.sCurve:
    case ChartType.pareto:
    case ChartType.rocCurve:
    case ChartType.lineRace:
    case ChartType.dualaxes:
    case ChartType.linestyleitem:
    case ChartType.bigdata:
      return ChartSeriesDataShape.cartesian;
    case ChartType.confusionMatrix:
      return ChartSeriesDataShape.matrix;
    case ChartType.parallel:
      return ChartSeriesDataShape.matrix;
    case ChartType.wordcloud:
      return ChartSeriesDataShape.pieLike;
    case ChartType.indicator:
      return ChartSeriesDataShape.radial;
    case ChartType.spiderline:
      return ChartSeriesDataShape.radial;
    case ChartType.alignedlabels:
    case ChartType.richlabelpie:
      return ChartSeriesDataShape.pieLike;
    default:
      return ChartSeriesDataShape.unknown;
  }
}