builder method
Implementation
@override
BasePainter builder(BuildContext context) {
final data = watchController();
final painter = MacdChartPainter(
paddingTop: widget.paddingTop,
pointSpace: data.getSpace(),
scrollX: data.getScrollX(),
scale: data.getScale(),
pressOffset: data.getPressOffset(),
values: data.values,
pointWidth: data.pointWidth,
upperStyle: widget.upperStyle,
fairStyle: widget.fairStyle,
lowerStyle: widget.lowerStyle,
upperColor: widget.upperColor,
fairColor: widget.fairColor,
lowerColor: widget.lowerColor,
strokeWidth: widget.strokeWidth,
gridLineWidth: widget.gridLineWidth,
gridLineColor: widget.gridLineColor,
gridHorizontalGrids: widget.gridHorizontalGrids,
gridVerticalGrids: widget.gridVerticalGrids,
deaLineColor: widget.deaLineColor,
difLineColor: widget.difLineColor,
difAndDeaLineWidth: widget.difAndDeaLineWidth,
crossLineColor: widget.crossLineColor,
crossLineWidth: widget.crossLineWidth,
textStyle: widget.textStyle,
showText: widget.showText,
transform: (values) {
return values.map((e) => e.macd!).toList();
},
transformBarStyle: (item) {
BarStyle style;
if (item.macd! < 0) {
style = BarStyle.lower;
} else {
style = BarStyle.upper;
}
return style;
},
);
return painter;
}