BaseTickDrawStrategy<D> constructor
BaseTickDrawStrategy<D> (
- ChartContext chartContext,
- GraphicsFactory graphicsFactory, {
- TextStyleSpec? labelStyleSpec,
- LineStyleSpec? axisLineStyleSpec,
- TickLabelAnchor? labelAnchor,
- TickLabelJustification? labelJustification,
- int? labelOffsetFromAxisPx,
- int? labelCollisionOffsetFromAxisPx,
- int? labelOffsetFromTickPx,
- int? labelCollisionOffsetFromTickPx,
- int? minimumPaddingBetweenLabelsPx,
- int? labelRotation,
- 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;
}