Legend constructor

const Legend({
  1. bool isVisible = false,
  2. LegendPosition position = LegendPosition.auto,
  3. ChartAlignment alignment = ChartAlignment.center,
  4. Color? backgroundColor,
  5. Color? borderColor,
  6. double borderWidth = 1.0,
  7. double opacity = 1.0,
  8. String? height,
  9. String? width,
  10. double padding = 10.0,
  11. double iconHeight = 12.0,
  12. double iconWidth = 12.0,
  13. bool shouldAlwaysShowScrollbar = false,
  14. bool toggleSeriesVisibility = true,
  15. TextStyle? textStyle,
  16. bool isResponsive = false,
  17. LegendItemOrientation orientation = LegendItemOrientation.auto,
  18. LegendTitle? title,
  19. LegendItemOverflowMode overflowMode = LegendItemOverflowMode.scroll,
  20. LegendItemBuilder? legendItemBuilder,
  21. Color? iconBorderColor,
  22. double? iconBorderWidth,
  23. double itemPadding = 15.0,
  24. Offset? offset,
  25. ImageProvider<Object>? image,
})

Creating an argument constructor of Legend class.

Implementation

const Legend({
  this.isVisible = false,
  this.position = LegendPosition.auto,
  this.alignment = ChartAlignment.center,
  this.backgroundColor,
  this.borderColor,
  this.borderWidth = 1.0,
  this.opacity = 1.0,
  this.height,
  this.width,
  this.padding = 10.0,
  this.iconHeight = 12.0,
  this.iconWidth = 12.0,
  this.shouldAlwaysShowScrollbar = false,
  this.toggleSeriesVisibility = true,
  this.textStyle,
  this.isResponsive = false,
  this.orientation = LegendItemOrientation.auto,
  this.title,
  this.overflowMode = LegendItemOverflowMode.scroll,
  this.legendItemBuilder,
  this.iconBorderColor,
  this.iconBorderWidth,
  this.itemPadding = 15.0,
  this.offset,
  this.image,
});