I found the solution. I continue using XYDataItem. I then use params parameter to include the option ticks, which would show the label on x-axis. JSONObject xaxis= new JSONObject(); xaxis.put("renderer", new JSONLiteral("jQuery.jqplot.CategoryAxisRenderer")); JSONArray ticksArray = new JSONArray(); ticksArray.put("Test1"); ticksArray.put("Test2"); xaxis.put("ticks", ticksArray); axes.put("xaxis", xaxis); json.put("axes", axes); options.put("options", json); return options; |