WOIBarGraph constructor

const WOIBarGraph({
  1. Key? key,
  2. required List<double> yaxisValues,
  3. required List<String> xaxisValues,
  4. required double height,
  5. required double width,
  6. Text? yAxisLabel,
  7. Text? xAxisLabel,
  8. Text? graphHeadingText,
  9. Color barColors = Colors.blue,
  10. Color incrementColors = Colors.red,
  11. Color backgroundColor = Colors.white,
  12. double barPadding = 5,
  13. double yaxisTextAndLinePadding = 30,
  14. double? labelPadding,
  15. double? headingPadding,
  16. TextStyle? textStyle,
  17. double yaxisLabelTextBoxSize = 30,
  18. double headingTextBoxSize = 30,
  19. double xaxisLableTextBoxSize = 30,
  20. double topPadding = 0,
})

Implementation

const WOIBarGraph({
  super.key,

  /// Values for the y component of the data points
  required this.yaxisValues,

  /// Values for the y component of the data points
  required this.xaxisValues,

  /// Height of the graph
  required this.height,

  /// Width of the graph
  required this.width,

  /// Labels to mark what the data on the y axis represents.
  this.yAxisLabel,

  /// Labels to mark what the data on the x axis represents.
  this.xAxisLabel,

  /// Hrading to mark what the data of the graph represents.
  this.graphHeadingText,

  /// Color of the bars.
  this.barColors = Colors.blue,

  /// Color of the y axis increments in the background.
  this.incrementColors = Colors.red,

  /// Background color of the complete widget. To adjust the background color properly to enwrap the whole widget a [topPadding] might be needed.
  this.backgroundColor = Colors.white,

  /// The left and the right padding on the bars. Setting this to 0 changes the bar graph to a historgram.
  this.barPadding = 5,

  /// The gap between the y axis increment lines and the increment values.
  this.yaxisTextAndLinePadding = 30,

  /// The gap between the graph and its labels
  this.labelPadding,

  /// The gap between the graph and its labels
  this.headingPadding,

  /// Text style for the labels and the increments.
  this.textStyle,

  /// Size for the text box for the label on the y axis. Might need to adjust this to fit different sized labels.
  this.yaxisLabelTextBoxSize = 30,

  /// Size for the text box for the heading. Might need to adjust this to fit different sized headings.
  this.headingTextBoxSize = 30,

  /// Size for the text box for the label on the x axis. Might need to adjust this to fit different sized labels.
  this.xaxisLableTextBoxSize = 30,

  /// This is to adding a padding on top. This will add a colored piece on top of the graph so that the background color completely enwraps the graph.
  this.topPadding = 0,
});