code: public static String jqPlotToJson(ChartConfiguration<?> jqPlot) {
  
          XStream xstream = new XStream(new JsonHierarchicalStreamDriver() {
  
              @Override
              public HierarchicalStreamWriter createWriter(Writer writer) {
                  return new JqPlotJsonMapHierarchicalWriter(writer, JsonWriter.DROP_ROOT_MODE) {
  
                      @Override
                      public void addAttribute(String name, String value) {
                          if (!name.contains("class")) {
                              super.addAttribute(name, value);
                          }
                      }
                  };
              }
          }) {
          };
  
          EnumConverter converter = new EnumConverter() {
  
              @Override
              public void marshal(Object source, HierarchicalStreamWriter writer,
                      MarshallingContext context) {
                  if(source instanceof JqPlotResources) {
                      JqPlotResources plugin = (JqPlotResources) source;
                      writer.setValue(plugin.getClassName());
                  } else {
                      super.marshal(source, writer, context);
                  }
  
              }
          };
  
          converter.canConvert(JqPlotResources.class);
  
          xstream.registerConverter(converter);
  
          return xstream.toXML(jqPlot);
      }
docs: Retorna o um json a partir de uma configuração jqplot
  @param jqPlot ChartConfiguration
  @return String of JSON content