LineChartPainter class

Inheritance

Constructors

LineChartPainter({required int maxLength, bool useShader = true, required List<AceEntity> values, required double scrollX, required double scale, required double pointWidth, required double pointSpace, Offset? pressOffset, required double strokeWidth, required double lastClose, required double paddingTop, required Color lineColor, required Color gridLineColor, required int gridVerticalGrids, required int gridHorizontalGrids, required TextStyle gridTextStyle, required TextStyle gridUpperStyle, required TextStyle gridlowerStyle, required double gridLineWidth, required Color centralAxisColor, required TextStyle centralAxisStyle, required TextStyle horizontalTextStyle, required TextStyle crossUpperTextStyle, required TextStyle crossLowerTextStyle, required Color crossTextBgColor, required Color crossTextBorderColor, required Color crossLineColor, required double crossLineWidth, required List<Color> maDayColors, required double maStrokeWidth, required String transformTime(int time), required Color averageLineColor, required double average, void onDrawCross(int index, MainAxisAlignment alignment, Offset pressOffset)?})

Properties

average double
finalinherited
averageLineColor Color
finalinherited
canvasHeight double
getter/setter pairinherited
canvasWidth double
getter/setter pairinherited
centralAxisColor Color
中轴线颜色
final
centralAxisStyle TextStyle
final
chartShader Shader?
getter/setter pair
contentHeight double
曲线图的绘制高度
getter/setter pairinherited
crossLineColor Color
finalinherited
crossLineWidth double
finalinherited
crossLowerTextStyle TextStyle
finalinherited
crossTextBgColor Color
finalinherited
crossTextBorderColor Color
finalinherited
crossUpperTextStyle TextStyle
交叉线样式
finalinherited
endIndex int
getter/setter pairinherited
gridHorizontalGrids int
网格水平分成几格
finalinherited
gridLineColor Color
网格线颜色
finalinherited
gridLineWidth double
finalinherited
gridlowerStyle TextStyle
网格数值比lastClose小时展示的颜色
finalinherited
gridTextStyle TextStyle
finalinherited
gridUpperStyle TextStyle
网格数值比lastClose大时展示的颜色
finalinherited
gridVerticalGrids int
网格垂直分成几格
finalinherited
hashCode int
The hash code for this object.
no setterinherited
horizontalTextStyle TextStyle
底部水平文字样式
finalinherited
lastClose double?
finalinherited
lineColor Color
final
maDayColors List<Color>
ma线颜色,对应多条ma线
finalinherited
maStrokeWidth double
ma线粗细
finalinherited
maxLength int
final
maxValue double
最大数据
getter/setter pairinherited
minValue double
最小数据
getter/setter pairinherited
onDrawCross → void Function(int index, MainAxisAlignment alignment, Offset pressOffset)?
绘制交叉线回调
finalinherited
paddingLeft double
finalinherited
paddingRight double
finalinherited
paddingTop double
finalinherited
pointSpace double
点之间的间距
finalinherited
pointWidth double
finalinherited
pressOffset Offset?
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale double
放大倍数
finalinherited
scrollX double
滚动位置
finalinherited
semanticsBuilder SemanticsBuilderCallback?
Returns a function that builds semantic information for the picture drawn by this painter.
no setterinherited
startIndex int
getter/setter pairinherited
strokeWidth double
final
transformTime String Function(int time)
finalinherited
useShader bool
final
values List<AceEntity>
finalinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be notified when it is time to repaint.
inherited
bisectionTransformXToIndex(double x, int start, int end) int
二分查找法
inherited
createText({required String text, required TextStyle style}) TextPainter
创建一个文本TextPainter
inherited
drawCentralAxis(Canvas canvas) → void
绘制中轴线
drawCross(Canvas canvas) → void
绘制交叉线
inherited
drawCrossLine({required Canvas canvas, required double canvasWidth, required double canvasHeight, required double scrollX, required double scale, required double dx, required double dy, required Color color, required double strokeWidth}) → void
交叉线
inherited
drawCrossText({required Canvas canvas, required double canvasWidth, required double canvasHeight, required double scrollX, required double scale, required double dx, required double dy, required double pressX, required String yText, required String xText, required TextStyle style, required Color bgColor, required Color borderColor}) → void
绘制交叉点文字
inherited
drawGrid({required Canvas canvas, required double canvasWidth, required double canvasHeight, required int verticalGrids, required int horizontalGrids, required Color lineColor, required double strokeWidth, required double paddingTop}) → void
inherited
drawGridText({required Canvas canvas, required double canvasWidth, required double canvasHeight, required int verticalGrids, required int horizontalGrids, required double maxValue, required double minValue, required double paddingTop, required TextStyle lowerStyle, required TextStyle upperStyle, required TextStyle gridTextStyle, double? lastClose}) → void
绘制网格文字
inherited
drawGridVerticalText({required Canvas canvas, required double canvasWidth, required double canvasHeight, required double value, required double dy, required TextStyle style, double? lastClose}) → void
绘制垂直文字
inherited
drawLine({required Canvas canvas, required double startX, required double startY, required double endX, required double endY, required double strokeWidth, required Color color}) → void
inherited
drawLineCart({required Canvas canvas, required int maxLength, required double strokeWidth, required Color lineColor, Shader? chartShader}) → void
绘制曲线图
inherited
drawVerticalDottedLine({required Canvas canvas, required double canvasWidth, required double y, required Color color, double scale = 1}) → void
绘制横虚线
inherited
dxToTransformX(double dx) double
X轴坐标值转translate后的坐标值
inherited
getCrossDx(int index) double
override
getCrossIndex() int
override
getRealItemWidth() double
inherited
getValues() List<double>
获取转换后的数据列表
inherited
hitTest(Offset position) bool?
Called whenever a hit test is being performed on an object that is using this custom paint delegate.
inherited
indexToX(int index) double
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onCompute(Size size) → void
获取画布宽度和高度 计算当前屏内相对转换后的X轴位置 根据X轴位置,计算屏内起始和结束展示数据的索引 计算最大值和最小值
override
onDraw(Canvas canvas) → void
override
onDrawCart(Canvas canvas) → void
绘制曲线
override
paint(Canvas canvas, Size size) → void
Called whenever the object needs to paint. The given Canvas has its coordinate space configured such that the origin is at the top left of the box. The area of the box is the size of the size argument.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that the object notifies when it is time to repaint.
inherited
shouldRebuildSemantics(covariant CustomPainter oldDelegate) bool
Called whenever a new instance of the custom painter delegate class is provided to the RenderCustomPaint object, or any time that a new CustomPaint object is created with a new instance of the custom painter delegate class (which amounts to the same thing, because the latter is implemented in terms of the former).
inherited
shouldRepaint(covariant CustomPainter oldDelegate) bool
Called whenever a new instance of the custom painter delegate class is provided to the RenderCustomPaint object, or any time that a new CustomPaint object is created with a new instance of the custom painter delegate class (which amounts to the same thing, because the latter is implemented in terms of the former).
inherited
toString() String
A string representation of this object.
inherited
transformValues() List<double>
override
transformXToIndex(double translateX) int
将translate后的坐标值转换成数据索引
inherited
valueToY(double value) double
override

Operators

operator ==(Object other) bool
The equality operator.
inherited