code: public XYSeries updateXYSeries(
        String seriesName,
        List<?> newXData,
        List<? extends Number> newYData,
        List<? extends Number> newErrorBarData) {
  
      DataType dataType = getDataType(newXData);
      switch (dataType) {
        case Date:
          return updateXYSeries(
              seriesName,
              Utils.getDoubleArrayFromDateList(newXData),
              Utils.getDoubleArrayFromNumberList(newYData),
              Utils.getDoubleArrayFromNumberList(newErrorBarData));
  
        default:
          return updateXYSeries(
              seriesName,
              Utils.getDoubleArrayFromNumberList(newXData),
              Utils.getDoubleArrayFromNumberList(newYData),
              Utils.getDoubleArrayFromNumberList(newErrorBarData));
      }
    }
docs: Update a series by updating the X-Axis, Y-Axis and error bar data
  
  @param seriesName
  @param newXData - set null to be automatically generated as a list of increasing Integers
  starting from 1 and ending at the size of the new Y-Axis data list.
  @param newYData
  @param newErrorBarData - set null if there are no error bars
  @return