code: def xtick(lab, top):
      """Get x-tick."""
      lab = str(lab)
      if len(lab) > top:
          lab = lab[: top - 3] + "..."
      return lab
  
imports: from __future__ import annotations
  import datetime
  import json
  import logging
  import math
  import warnings
  from collections import defaultdict
  import numpy
  import pandas
  import plotly.express
  import plotly.graph_objects
  from popmon.resources import templates_env
label_desc: Use image node_id 1 for calling a global function with example usage: xtick(lab, top) and returns: lab