drawText method

  1. @override
void drawText(
  1. Canvas canvas,
  2. VolumeEntity data,
  3. double x
)
override

Implementation

@override
void drawText(Canvas canvas, VolumeEntity data, double x) {
  TextSpan span = TextSpan(
    children: [
      TextSpan(text: "VOL:${NumberUtil.format(data.vol)}    ", style: getTextStyle(style.colors.vol)),
      if (data.MA5Volume.notNullOrZero) TextSpan(text: "MA5:${NumberUtil.format(data.MA5Volume!)}    ", style: getTextStyle(style.colors.ma5)),
      if (data.MA10Volume.notNullOrZero) TextSpan(text: "MA10:${NumberUtil.format(data.MA10Volume!)}    ", style: getTextStyle(style.colors.ma10))
    ]
  );
  final tp = TextPainter(text: span, textDirection: TextDirection.ltr);
  tp.layout();
  tp.paint(canvas, Offset(x, chartRect.top - style.padding.top));
}