BrnFunnelChart class
漏斗图 漏斗图有两种样式
_文案_/ |文案_/
___________ + ____________
_文案__/ |_文案/
第一种,是两边都向中间缩短的漏斗FunnelShape.leftAndRight。
第二种,是只有一边向中间缩短的漏斗FunnelShape.leftOrRight。
通过inputTextStyle
来控制样式。
在漏斗的两层layer之间或者左右可以插入标签markers,它们可以是一些常见的Widget,如Text,在参数children中提供。
通过alignment可以控制标签的插入位置。
使用layerMargin可以控制两层layer之间的间距。
每层layer支持自定义图案绘制,绘制参考BrnFunnelLayerPainter类定义
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- RenderObjectWidget
- MultiChildRenderObjectWidget
- BrnFunnelChart
- Available Extensions
Constructors
- BrnFunnelChart({Key? key, required int layerCount, required int markerCount, required BrnFunnelLayerPainter layerPainter, required MarkerBuilder builder, FunnelShape shape = FunnelShape.leftAndRight, double maxLayerWidth = 200, double minLayerWidth = 0, double layerHeight = 40, double layerMargin = 0, Offset childOffset = Offset.zero, MarkerAlignment alignment = MarkerAlignment.right})
- BrnFunnelChart.defaultStyle({Key? key, required int layerCount, required int markerCount, required MarkerBuilder builder, double maxLayerWidth = 200, double minLayerWidth = 0, double layerHeight = 40, double layerMargin = 0, Offset childOffset = Offset.zero})
-
漏斗图默认Bruno风格的命名构造函数,layerCount不能大于
defaultLayerColors.length
。
Properties
- alignment → MarkerAlignment
-
漏斗标签marker的摆放位置
final
- childOffset → Offset
-
漏斗标签marker的偏移量
final
-
children
→ List<
Widget> -
The widgets below this widget in the tree.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- layerCount → int
-
漏斗的层数
final
- layerHeight → double
-
漏斗每层的高度
final
- layerMargin → double
-
漏斗每层之间的距离
final
- layerPainter → BrnFunnelLayerPainter
-
用于每层layer的绘制,可以继承BrnFunnelLayerPainter对每层的绘制进行定制
final
- markerCount → int
-
漏斗标签的个数,如果和layerCount相等说明是一对一的关系。如果比layerCount少一,说明描述的事layer之间的关系。
除此之外的情形将会被认为是错误参数
final
- maxLayerWidth → double
-
漏斗的最大宽度,一般是漏斗最上层的宽度
final
- minLayerWidth → double
-
漏斗的最小宽度,一般是漏斗最下层的宽度
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shape → FunnelShape
-
漏斗类型
final
Methods
-
createElement(
) → MultiChildRenderObjectElement -
RenderObjectWidgets always inflate to a RenderObjectElement subclass.
inherited
-
createRenderObject(
BuildContext context) → RenderObject -
Creates an instance of the RenderObject class that this
RenderObjectWidget represents, using the configuration described by this
RenderObjectWidget.
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
-
didUnmountRenderObject(
covariant RenderObject renderObject) → void -
A render object previously associated with this widget has been removed
from the tree. The given RenderObject will be of the same type as
returned by this object's createRenderObject.
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
-
updateRenderObject(
BuildContext context, covariant RenderFunnelChart renderObject) → void -
Copies the configuration described by this RenderObjectWidget to the
given RenderObject, which will be of the same type as returned by this
object's createRenderObject.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
defaultLayerColors
→ const List<
Color> - Bruno风格的每层layer预设的颜色值,按顺序使用颜色值。实际层数超过该数量需要自行定义。