code: public static Axis generateAxisFromCollection(List<Float> axisValues, List<String> axisValuesLabels) {
          if (axisValues.size() != axisValuesLabels.size()) {
              throw new IllegalArgumentException("Values and labels lists must have the same size!");
          }
  
          List<AxisValue> values = new ArrayList<AxisValue>();
          int index = 0;
          for (float value : axisValues) {
              AxisValue axisValue = new AxisValue(value).setLabel(axisValuesLabels.get(index));
              values.add(axisValue);
              ++index;
          }
  
          Axis axis = new Axis(values);
          return axis;
      }
docs: Generates Axis with values and labels from given lists, both lists must have the same size.