BaseTickDrawStrategy<D> constructor

BaseTickDrawStrategy<D>(
  1. ChartContext chartContext,
  2. GraphicsFactory graphicsFactory, {
  3. TextStyleSpec? labelStyleSpec,
  4. LineStyleSpec? axisLineStyleSpec,
  5. TickLabelAnchor? labelAnchor,
  6. TickLabelJustification? labelJustification,
  7. int? labelOffsetFromAxisPx,
  8. int? labelCollisionOffsetFromAxisPx,
  9. int? labelOffsetFromTickPx,
  10. int? labelCollisionOffsetFromTickPx,
  11. int? minimumPaddingBetweenLabelsPx,
  12. int? labelRotation,
  13. int? labelCollisionRotation,
})

Implementation

BaseTickDrawStrategy(
  this.chartContext,
  this.graphicsFactory, {
  TextStyleSpec? labelStyleSpec,
  LineStyleSpec? axisLineStyleSpec,
  TickLabelAnchor? labelAnchor,
  TickLabelJustification? labelJustification,
  int? labelOffsetFromAxisPx,
  int? labelCollisionOffsetFromAxisPx,
  int? labelOffsetFromTickPx,
  int? labelCollisionOffsetFromTickPx,
  int? minimumPaddingBetweenLabelsPx,
  int? labelRotation,
  int? labelCollisionRotation,
})  : labelStyle = graphicsFactory.createTextPaint(),
      axisLineStyle = graphicsFactory.createLinePaint(),
      _defaultTickLabelAnchor = labelAnchor ?? TickLabelAnchor.centered,
      tickLabelJustification =
          labelJustification ?? TickLabelJustification.inside,
      _rotateOnCollision = labelCollisionRotation != null,
      minimumPaddingBetweenLabelsPx = minimumPaddingBetweenLabelsPx ?? 50,
      _labelDefaultOffsetFromAxisPx = labelOffsetFromAxisPx ?? 5,
      _labelDefaultOffsetFromTickPx = labelOffsetFromTickPx ?? 5,
      _labelDefaultRotation = labelRotation ?? 0,
      _labelCollisionOffsetFromAxisPx = labelCollisionOffsetFromAxisPx ?? 5,
      _labelCollisionOffsetFromTickPx = labelCollisionOffsetFromTickPx ?? 5,
      _labelCollisionRotation = labelCollisionRotation ?? 0 {
  labelStyle
    ..color = labelStyleSpec?.color ?? StyleFactory.style.tickColor
    ..fontFamily = labelStyleSpec?.fontFamily
    ..fontSize = labelStyleSpec?.fontSize ?? 12
    ..lineHeight = labelStyleSpec?.lineHeight
    ..fontWeight = labelStyleSpec?.fontWeight ?? '400';

  axisLineStyle
    ..color = axisLineStyleSpec?.color ?? labelStyle.color
    ..dashPattern = axisLineStyleSpec?.dashPattern
    ..strokeWidth = axisLineStyleSpec?.thickness ?? 1;
}