Alireza Fattahi Alireza Fattahi - 1 year ago 48
Javascript Question

Struts 2 jquery plugin, chart plugin does not support categories

The chart component in the Struts 2 jQuery plugin version 3.6 seems not supporting the

plugin for the

I want to use
Flot With “String” x-axis
for chart and the best solution is to use
(Described at Flot With "String" x-axis).

As I review some struts-jquery-plugin codes. I found that the
does not use this plugin, on the other hand the
file is in the

Please let me know how can I fix it ?! I think I can extend the used jquery objects ( may be
) and add it but don't know how ?!

Answer Source

It's easily fixable, just modify your jquery.chart.struts2.js and add the following code.

if ((o.xaxis && o.xaxis.mode === "categories") || (o.yaxis && o.yaxis.mode === "categories")) {
    self.require("js/flot/jquery.flot.categories" + self.minSuffix + ".js");

If you like to know how to use custom theme with Struts2 jQuery plugin, you should read Overriding Struts2 jqGrid CSS.