code: public OHLCSeries updateOHLCSeries(
        String seriesName,
        double[] newXData,
        double[] newOpenData,
        double[] newHighData,
        double[] newLowData,
        double[] newCloseData) {
  
      sanityCheck(seriesName, newOpenData, newHighData, newLowData, newCloseData);
  
      Map<String, OHLCSeries> seriesMap = getSeriesMap();
      OHLCSeries series = seriesMap.get(seriesName);
      if (series == null) {
        throw new IllegalArgumentException("Series name >" + seriesName + "< not found!!!");
      }
      final double[] xDataToUse;
      if (newXData != null) {
        // Sanity check
        checkDataLengths(seriesName, "X-Axis", "Close", newXData, newCloseData);
        xDataToUse = newXData;
      } else {
        xDataToUse = Utils.getGeneratedDataAsArray(newCloseData.length);
      }
  
      series.replaceData(xDataToUse, newOpenData, newHighData, newLowData, newCloseData);
  
      return series;
    }
docs: Update a series by updating the X-Axis and Y-Axis
  
  @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 newOpenData
  @param newHighData
  @param newLowData
  @param newCloseData
  @return