WOILineGraph class
WOILineGraph is a simple and easy to use line graph widget.
Here is an example of the WOILineGraph
WOILineGraph(
height: 300,
width: 340,
yaxisValues: const [0.1, 0.2, 0.3, 0.4, 10, 0.6, 0.7, 0.8, 0.1],
xaxisValues: const [1, 2, 3, 4, 5, 6, 'Sun', '', ''],
filledGraph: true,
dottedYaxis: true,
dataPointColor: Colors.grey,
dataPointSize: 2,
xaxisAndTextGap: 20,
xaxisSeparatorLength: 3,
fillColor: Colors.lightBlue.withOpacity(0.2),
lineColor: Colors.blue,
),
,,,
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- WOILineGraph
Constructors
-
WOILineGraph({Key? key, required double height, required double width, required List<
LineProperties> yaxisValues, required List xaxisValues, double yaxisTextBoxWidth = 40, Color backgroundColor = Colors.white, double xaxisSeparatorLength = 3, double xaxisAndTextGap = 30, double topSpacing = 10, double bottomSpacing = 0, double leftSpacing = 0, Color incrementLineColor = Colors.red, bool dottedYaxis = false, Text? heading, Text? xaxisLabel, Text? yaxisLabel}) -
The WOILineGraph essentially requires four variables i.e height, width, xaxisValues, yaxisValues.
Number of entries should be equal in the xaxisValues and the yaxisValues list.
const
Properties
- backgroundColor → Color
-
Background color of the graph
final
- bottomSpacing → double
-
Adds spacing to the bottom. Will need to be adjusted when adding an xaxis label.
final
- dottedYaxis → bool
-
Change the style of the yaxis lines from solid to dotted.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- heading → Text?
-
Heading text to indicate what the graph represents
final
- height → double
-
The height from the xaxis to the top most increment.
final
- incrementLineColor → Color
-
Color of the yaxis increment lines. Set this to transparent to get rid of the lines.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- leftSpacing → double
-
Adds spacing to the left. Will need to be adjusted when adding an yaxis label.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- topSpacing → double
-
Changes height of the widget to adjust for how much of the top area needs to be incorporated in the background color. Will also be needed when adding heading.
final
- width → double
-
The width of the complete widget.
final
- xaxisAndTextGap → double
-
Gap between the xaxis and its values.
final
- xaxisLabel → Text?
-
Label text to indicate what the xaxis reporesents
final
- xaxisSeparatorLength → double
-
Length of the vertical lines separating each xaxis increment.
final
- xaxisValues → List
-
The xaxis points for every data point.
final
- yaxisLabel → Text?
-
Label text to indicate what the xaxis reporesents
final
- yaxisTextBoxWidth → double
-
Width of the text box wrapping the increments on the yaxis. This can be used to fix overflow issues if the text size increases.
final
-
yaxisValues
→ List<
LineProperties> -
The yaxis points for every data point.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< WOILineGraph> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited