* @param component
* @return
* @throws IOException
*/
public JSONObject getOpts(FacesContext context, UIComponent component) throws IOException {
JSONObject obj = new JSONObject();
addAttribute(obj, "zoom", component.getAttributes().get("zoom"));
addAttribute(obj, "charttype", component.getAttributes().get("charttype"));
addAttribute(obj, "xtype", component.getAttributes().get("xtype"));
addAttribute(obj, "ytype", component.getAttributes().get("ytype"));
JSONObject xaxis = new JSONObject();
addAttribute(xaxis, "min", component.getAttributes().get("xmin"));
addAttribute(xaxis, "max", component.getAttributes().get("xmax"));
addAttribute(xaxis, "autoscaleMargin", component.getAttributes().get("xpad"));
addAttribute(xaxis, "axisLabel", component.getAttributes().get("xlabel"));
addAttribute(xaxis, "format", component.getAttributes().get("xformat"));
JSONObject yaxis = new JSONObject();
addAttribute(yaxis, "min", component.getAttributes().get("ymin"));
addAttribute(yaxis, "max", component.getAttributes().get("ymax"));
addAttribute(yaxis, "autoscaleMargin", component.getAttributes().get("ypad"));
addAttribute(yaxis, "axisLabel", component.getAttributes().get("ylabel"));
addAttribute(yaxis, "format", component.getAttributes().get("yformat"));
JSONObject legend = new JSONObject();
addAttribute(legend, "position", component.getAttributes().get("position"));
addAttribute(legend, "sorted", component.getAttributes().get("sorting"));
addAttribute(obj, "xaxis", xaxis);
addAttribute(obj, "yaxis", yaxis);