toJson method

Json toJson()

Implementation

Json toJson() => {
      if (!grid) 'grid': grid,
      if (scale != 'index') 'scale': scale,
      if (field.isNotEmpty) 'field': field,
      if (min != null) 'min': min,
      if (max != null) 'max': max,
      if (tickValues.isNotEmpty) 'tickValues': [for (final t in tickValues) t.toJson()],
      'label': label,
      'format': format,
      'barSpacing': barSpacing,
      'minBarSpacing': minBarSpacing,
      'maxBarSpacing': maxBarSpacing,
      'rightOffset': rightOffset,
      'follow': follow,
      'clamp': clamp,
      'overscroll': overscroll,
      'axisHeight': axisHeight,
      'labels': labels,
      'historyThreshold': historyThreshold,
      'moreHistory': moreHistory,
      'fit': fit,
      if (slots != null) 'slots': slots,
      if (tickEvery != null) 'tickEvery': tickEvery,
      if (maxBarWidth != null) 'maxBarWidth': maxBarWidth,
      'ticks': ticks,
      'morph': morph,
      if (bands.isNotEmpty) 'bands': [for (final b in bands) b.toJson()],
      if (inset != 0) 'inset': inset,
    };