Controller<P extends ChartPainter<ChartData<IDataSet<Entry>>?>> constructor

Controller<P extends ChartPainter<ChartData<IDataSet<Entry>>?>>({
  1. IMarker? marker,
  2. Description? description,
  3. ViewPortHandler? viewPortHandler,
  4. XAxis? xAxis,
  5. Legend? legend,
  6. LegendRenderer? legendRenderer,
  7. OnChartValueSelectedListener? selectionListener,
  8. double maxHighlightDistance = 100.0,
  9. bool highLightPerTapEnabled = true,
  10. double extraTopOffset = 0.0,
  11. double extraRightOffset = 0.0,
  12. double extraBottomOffset = 0.0,
  13. double extraLeftOffset = 0.0,
  14. bool drawMarkers = true,
  15. bool resolveGestureHorizontalConflict = false,
  16. bool resolveGestureVerticalConflict = false,
  17. double descTextSize = 12,
  18. double infoTextSize = 12,
  19. Color? descTextColor,
  20. Color? infoTextColor,
  21. Color? infoBgColor,
  22. TextPainter? descPaint,
  23. TextPainter? infoPaint,
  24. String noDataText = "No chart data available.",
  25. XAxisSettingFunction? xAxisSettingFunction,
  26. LegendSettingFunction? legendSettingFunction,
  27. DataRendererSettingFunction? rendererSettingFunction,
})

Implementation

Controller({this.marker,
  this.description,
  this.viewPortHandler,
  this.xAxis,
  this.legend,
  this.legendRenderer,
  this.selectionListener,
  this.maxHighlightDistance = 100.0,
  this.highLightPerTapEnabled = true,
  this.extraTopOffset = 0.0,
  this.extraRightOffset = 0.0,
  this.extraBottomOffset = 0.0,
  this.extraLeftOffset = 0.0,
  this.drawMarkers = true,
  bool resolveGestureHorizontalConflict = false,
  bool resolveGestureVerticalConflict = false,
  double descTextSize = 12,
  double infoTextSize = 12,
  Color? descTextColor,
  Color? infoTextColor,
  this.infoBgColor,
  this.descPaint,
  this.infoPaint,
  String noDataText = "No chart data available.",
  this.xAxisSettingFunction,
  this.legendSettingFunction,
  this.rendererSettingFunction}) {
  animator = ChartAnimatorBySys(this);
  descTextColor = ColorUtils.black;
  descPaint = PainterUtils.create(null, null, descTextColor, descTextSize,
      fontFamily: description?.typeface?.fontFamily,
      fontWeight: description?.typeface?.fontWeight);
  infoTextColor ??= ColorUtils.black;
  infoPaint =
      PainterUtils.create(null, noDataText, infoTextColor, infoTextSize);
  infoBgColor ??= ColorUtils.white;

  if (maxHighlightDistance == 0.0) {
    maxHighlightDistance = Utils.convertDpToPixel(500);
  }

  this.viewPortHandler ??= initViewPortHandler();
  this.marker ??= initMarker();
  this.description ??= initDescription();
  this.selectionListener ??= initSelectionListener();

  if (resolveGestureHorizontalConflict) {
    horizontalConflictResolveFunc = () => true;
  }

  if (resolveGestureVerticalConflict) {
    verticalConflictResolveFunc = () => true;
  }
}