StackBar<T> class
stackBar 支持水平/垂直排列
- Inheritance
-
- Object
- ChartBodyRender<
T> - StackBar
- Mixed in types
Constructors
-
StackBar({required List<
T> data, required ChartPosition<T> position, required StackBarPosition<T> values, int yAxisPosition = 0, Color? highlightColor = Colors.yellow, List<Color> colors = colors10, List<Shader> ? shaders, double itemWidth = 20, Axis direction = Axis.horizontal, bool full = false, double padding = 5, Color? hotColor, BarValuesFormatter? valuesFormatter, TextStyle textStyle = const TextStyle(fontSize: 10, color: Colors.black), Offset valueOffset = Offset.zero})
Properties
- chartState ↔ ChartLayoutState
-
图表的布局状态
getter/setter pairinherited
-
colors
→ List<
Color> -
多个颜色
final
- controller ↔ ChartController
-
getter/setter pairinherited
-
data
→ List<
T> -
数据源
finalinherited
- direction → Axis
-
方向
final
- full → bool
-
撑满 如果为true则会根据实际数值的总和求比例,如果为false则会根据Y轴最大值求比例
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- highlightColor → Color?
-
高亮颜色
final
- hotColor → Color?
-
绘制热区 颜色
final
- index ↔ int
-
在图表中的位置
getter/setter pairinherited
- isInit ↔ bool
-
getter/setter pairinherited
- itemWidth → double
-
bar的宽度
final
- padding → double
-
两个bar之间的间距
final
-
position
→ ChartPosition<
T> -
不要使用过于耗时的方法
数据在坐标系的位置,每个坐标系下取值逻辑不一样,在line和bar下是相对于每格的值,比如xAxis的interval为1,你的数据放在1列和2列中间,那么position就是0.5,在pie下是比例
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
shaders
→ List<
Shader> ? -
优先级高于colors
final
- textStyle → TextStyle
-
值文字样式
final
- valueOffset → Offset
-
文案偏移
final
-
values
→ StackBarPosition<
T> -
值格式化
final
- valuesFormatter → BarValuesFormatter?
-
值文案格式化 不要使用过于耗时的方法
final
- yAxisPosition → int
-
跟哪个y轴关联
finalinherited
Methods
-
draw(
Canvas canvas, ChartsState state) → void -
getLastData(
bool need) → List< ChartItemLayoutState> ? -
inherited
-
init(
ChartsState state) → void -
初始化 耗时的方法都可以放到这里
inherited
-
lerpList(
List< num> ? a, List<num> ? b, double t) → List<num> ? -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited