CLBarChart<T> class
Bar chart generico basato su fl_chart.
Esempio d'uso:
CLBarChart<SalesData>(
data: salesList,
xValueMapper: (item, _) => item.month,
yValueMapper: (item, _) => item.amount,
barColor: Colors.teal,
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- CLBarChart
- Available extensions
Constructors
-
CLBarChart({Key? key, required List<
T> data, required String xValueMapper(T item, int index), required double yValueMapper(T item, int index), Color? barColor, double barWidth = 18, double? maxY, double? minY, bool showGrid = false, double? leftAxisInterval, Widget leftTitleBuilder(double value, TitleMeta meta)?, Widget bottomTitleBuilder(double value, TitleMeta meta)?, BarTooltipItem? tooltipBuilder(T item, int index, BarChartRodData rod)?, BorderRadius? borderRadius, bool rotateLabels = true, double rotateThreshold = 400}) -
const
Properties
- barColor → Color?
-
Colore delle barre. Default:
CLTheme.of(context).primary.final - barWidth → double
-
Larghezza di ciascuna barra.
final
- borderRadius → BorderRadius?
-
Border radius delle barre.
final
- bottomTitleBuilder → Widget Function(double value, TitleMeta meta)?
-
Builder custom per le label dell'asse inferiore.
Se null, usa il risultato di xValueMapper.
final
-
data
→ List<
T> -
Dati sorgente.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- leftAxisInterval → double?
-
Intervallo tra le label dell'asse sinistro (es. 10000).
final
- leftTitleBuilder → Widget Function(double value, TitleMeta meta)?
-
Builder custom per le label dell'asse sinistro.
final
- maxY → double?
-
Valore massimo asse Y. Se null, viene calcolato automaticamente.
final
- minY → double?
-
Valore minimo asse Y. Default 0.
final
- rotateLabels → bool
-
Ruota automaticamente le label quando la larghezza è sotto rotateThreshold.
final
- rotateThreshold → double
-
Soglia in pixel sotto la quale le label vengono ruotate.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showGrid → bool
-
Mostra la griglia di sfondo.
final
- tooltipBuilder → BarTooltipItem? Function(T item, int index, BarChartRodData rod)?
-
Builder custom per il tooltip.
final
- xValueMapper → String Function(T item, int index)
-
Estrae la label dell'asse X da un elemento.
final
- yValueMapper → double Function(T item, int index)
-
Estrae il valore numerico dell'asse Y da un elemento.
final
Methods
-
animateOnActionTrigger(
AnimationInfo animationInfo, {bool hasBeenTriggered = false}) → Widget -
Available on Widget, provided by the AnimatedWidgetExtension extension
-
animateOnPageLoad(
AnimationInfo animationInfo) → Widget -
Available on Widget, provided by the AnimatedWidgetExtension extension
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< CLBarChart< T> > -
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, int wrapWidth = 65}) → 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