BezierChart constructor

BezierChart({
  1. Key? key,
  2. BezierChartConfig? config,
  3. List<double>? xAxisCustomValues,
  4. FooterValueBuilder? footerValueBuilder,
  5. FooterValueBuilder? bubbleLabelValueBuilder,
  6. FooterDateTimeBuilder? footerDateTimeBuilder,
  7. FooterDateTimeBuilder? bubbleLabelDateTimeBuilder,
  8. DateTime? fromDate,
  9. DateTime? toDate,
  10. DateTime? selectedDate,
  11. ValueChanged<bool>? onIndicatorVisible,
  12. ValueChanged<DateTime?>? onDateTimeSelected,
  13. ValueChanged<double?>? onValueSelected,
  14. double? selectedValue,
  15. BezierChartAggregation bezierChartAggregation = BezierChartAggregation.sum,
  16. required BezierChartScale bezierChartScale,
  17. required List<BezierLine> series,
  18. ValueChanged<BezierChartScale?>? onScaleChanged,
})

Implementation

BezierChart({
  Key? key,
  this.config,
  this.xAxisCustomValues,
  this.footerValueBuilder,
  this.bubbleLabelValueBuilder,
  this.footerDateTimeBuilder,
  this.bubbleLabelDateTimeBuilder,
  this.fromDate,
  this.toDate,
  this.selectedDate,
  this.onIndicatorVisible,
  this.onDateTimeSelected,
  this.onValueSelected,
  this.selectedValue,
  this.bezierChartAggregation = BezierChartAggregation.sum,
  required this.bezierChartScale,
  required this.series,
  this.onScaleChanged,
})  : assert(
        (bezierChartScale == BezierChartScale.custom &&
                xAxisCustomValues != null) ||
            bezierChartScale != BezierChartScale.custom,
        "The xAxisCustomValues and series must not be null",
      ),
      assert(
        bezierChartScale == BezierChartScale.custom &&
                _isSorted(xAxisCustomValues!) ||
            bezierChartScale != BezierChartScale.custom,
        "The xAxisCustomValues must be sorted in increasing way",
      ),
      assert(
        bezierChartScale == BezierChartScale.custom &&
                _compareLengths(xAxisCustomValues!.length, series) ||
            bezierChartScale != BezierChartScale.custom,
        "xAxisCustomValues lenght must be equals to series length",
      ),
      assert(
        (bezierChartScale == BezierChartScale.custom &&
                _areAllPositive(xAxisCustomValues!) &&
                _checkCustomValues(series)) ||
            bezierChartScale != BezierChartScale.custom,
        "xAxisCustomValues and series must be positives",
      ),
      assert(
        (((bezierChartScale != BezierChartScale.custom) &&
                fromDate != null &&
                toDate != null) ||
            (bezierChartScale == BezierChartScale.custom &&
                fromDate == null &&
                toDate == null)),
        "fromDate and toDate must not be null",
      ),
      assert(
        (((bezierChartScale != BezierChartScale.custom) &&
                toDate!.isAfter(fromDate!)) ||
            (bezierChartScale == BezierChartScale.custom &&
                fromDate == null &&
                toDate == null)),
        "toDate must be after of fromDate",
      ),
      super(key: key);