tooltip2 method

List<Figure> tooltip2(
  1. Offset anchor,
  2. List<Map<String, dynamic>> selectedTuples
)

Implementation

List<Figure> tooltip2(Offset anchor, List<Map<String, dynamic>> selectedTuples) {
  String textContent = '';
  if (selectedTuples.length == 1) {
    final original = selectedTuples.single;
    if (original['points'] > 0) {
      textContent = 'Ngày: ' + original['date'] + '\n';
      textContent += 'SP: ' + original['name'] + '\n';
      textContent += 'Giá: ' + Util.doubleToString(original['points']) + ' đ';
    } else {
      return [];
    }
  }

  return _renderFigure(anchor, textContent);
}