BarChartPainter<T> class

Inheritance
Mixed-in types
Implementers

Constructors

BarChartPainter({required List<T> values, bool showValueText = false, double valueTextFontSize = 0, required double paddingTop, required double scrollX, required double scale, required double pointSpace, required double pointWidth, required double strokeWidth, required PaintingStyle upperStyle, required PaintingStyle fairStyle, required PaintingStyle lowerStyle, required Color upperColor, required Color fairColor, required Color lowerColor, required Color crossLineColor, required double crossLineWidth, required int gridHorizontalGrids, required int gridVerticalGrids, required Color gridLineColor, required double gridLineWidth, required List<double> transform(List<T> values), required BarStyle transformBarStyle(T item), required TextStyle textStyle, required bool showText, Offset? pressOffset})

Properties

canvasHeight double
getter/setter pairinherited
canvasWidth double
getter/setter pairinherited
contentHeight double
getter/setter pair
crossLineColor Color
交叉线样式
final
crossLineWidth double
final
endIndex int
getter/setter pairinherited
fairColor Color
final
fairStyle PaintingStyle
final
gridHorizontalGrids int
网格水平分成几格
final
gridLineColor Color
网格线颜色
final
gridLineWidth double
final
gridVerticalGrids int
网格垂直分成几格
final
hashCode int
The hash code for this object.
no setterinherited
lowerColor Color
final
lowerStyle PaintingStyle
final
maxValue double
最大数据
getter/setter pairinherited
minValue double
最小数据
getter/setter pairinherited
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
showText bool
final
showValueText bool
final
startIndex int
getter/setter pairinherited
strokeWidth double
final
textStyle TextStyle
final
transform List<double> Function(List<T> values)
final
transformBarStyle BarStyle Function(T item)
final
upperColor Color
final
upperStyle PaintingStyle
final
values List<T>
final
valueTextFontSize double
final

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
drawCandle({required Canvas canvas, required PaintingStyle style, required double strokeWidth, required double scale, required Color color, required double dx, required double width, required double highY, required double lowY, required double closeY, required double openY}) → void
inherited
drawChart(Canvas canvas) → void
drawCross(Canvas canvas) → void
绘制交叉线
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
drawHistogram({required Canvas canvas, required PaintingStyle style, required double strokeWidth, required double scale, required Color color, required Rect rect}) → 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
drawText(Canvas canvas) → void
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
getRealItemWidth() double
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
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.
override
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