configure method

void configure(
  1. Axis<D> axis,
  2. ChartContext context,
  3. GraphicsFactory graphicsFactory
)

Implementation

void configure(
    Axis<D> axis, ChartContext context, GraphicsFactory graphicsFactory) {
  axis.resetDefaultConfiguration();

  if (showAxisLine != null) {
    axis.forceDrawAxisLine = showAxisLine;
  }

  if (renderSpec != null) {
    axis.tickDrawStrategy =
        renderSpec!.createDrawStrategy(context, graphicsFactory);
  }

  if (tickProviderSpec != null) {
    axis.tickProvider = tickProviderSpec!.createTickProvider(context);
  }

  if (tickFormatterSpec != null) {
    axis.tickFormatter = tickFormatterSpec!.createTickFormatter(context);
  }

  if (scaleSpec != null) {
    axis.scale = scaleSpec!.createScale() as MutableScale<D>;
  }
}