code: public static int getSeriesIndex(final Options options, final int wickedChartsId) {
          int index = 0;
          if (options.getSeries() == null) {
              throw new IllegalStateException("The given Options object does not contain any series!");
          }
          for (Series<?> series : options.getSeries()) {
              if (series.getWickedChartsId() == wickedChartsId) {
                  return index;
              }
              index++;
          }
          return 0;
      }
docs: Returns the (0-based) index of the series with the given wickedChartsId or
  null.
  
  @param options        the options in which to search
  @param wickedChartsId the wickedChartsId of the series
  @return the index of the series with the given id. Returns 0 if no series
  was found.