XAxis class
x轴配置
Constructors
- XAxis({required int count, AxisFormatter? formatter, num interval = 1, bool drawLine = true, bool drawGrid = false, bool drawLabel = true, bool zoom = false, Color lineColor = const Color(0x99cccccc), TextStyle textStyle = const TextStyle(fontSize: 12, color: Colors.grey), bool drawDivider = false, AxisDivideCountAtAmplify? divideCount, num? max})
Properties
- count → int
-
方便计算,count代表一屏显示的格子数
final
- density ↔ double
-
每1个逻辑value代表多宽, 在绘制过程中如果使用Matrix4转换不便更为细腻的控制,所以设计出了密度的概念
getter/setter pair
- divideCount → AxisDivideCountAtAmplify?
-
放大时单item下分隔数量
final
- drawDivider → bool
-
是否有分隔线
final
- drawGrid → bool
-
是否画格子线
final
- drawLabel → bool
-
是否绘制label
final
- drawLine ↔ bool
-
是否绘制最下面一行的线
getter/setter pair
- fixedDensity ↔ double
-
固定的密度,不随缩放变动
getter/setter pair
- formatter → AxisFormatter?
-
x轴文案格式化 不要使用过于耗时的方法
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- interval → num
-
每个格子代表的值
final
- lineColor → Color
-
最边上的线的颜色
final
- linePaint → Paint
-
轴线
latefinal
- max → num
-
x轴最大值, 最大格子数 = max / interval, 如果最大格子数 == count,则不会滚动, 默认值为count的值
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- textStyle → TextStyle
-
文字颜色
final
- zoom → bool
-
final
Methods
-
getDashPath(
int index, Offset endPoint) → Path - x轴的虚线
-
getWidth(
num value, [bool fixed = false]) → double - 根据元数据计算出对应的宽带
-
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