code: def _scale_x_values(self, values, max_width):
          '''Scale X values to new width'''
  
          if type(values) == dict:
              values = self._scale_x_values_timestamps(values=values, max_width=max_width)
  
          adjusted_values = list(values)
          if len(adjusted_values) > max_width:
  
              def get_position(current_pos):
                  return len(adjusted_values) * current_pos // max_width
  
              adjusted_values = [statistics.mean(adjusted_values[get_position(i):get_position(i + 1)]) for i in range(max_width)]
  
          return adjusted_valuef _scale_x_values(self, values, max_width):
          '''Scale X values to new width'''
  
          if type(values) == dict:
              values = self._scale_x_values_timestamps(values=values, max_width=max_width)
  
          adjusted_values = list(values)
          if len(adjusted_values) > max_width:
  
              def get_position(current_pos):
                  return len(adjusted_values) * current_pos // max_width
  
              adjusted_values = [statistics.mean(adjusted_values[get_position(i):get_position(i + 1)]) for i in range(max_width)]
  
          return adjusted_values
docs: Scale X values to new width