Note that there are some explanatory texts on larger screens.

plurals
  1. PONot able to plot Date values in json graph using Struts 2 jquery chart plugin 3.4.0
    primarykey
    data
    text
    <p>I am using Struts2 jquery chart plugin 3.4.0. I am getting blank chart when i use json for getting date values from the Action class.If i use simple action then same code works fine. Here is my jsp code.</p> <pre><code> &lt;s:url id="chartDataUrl" action="jsonChartData"/&gt; &lt;sjc:chart id="chartDate" xaxisMode="time" xaxisTimeformat="%m.%Y" xaxisMin="%{minTime}" xaxisMax="%{maxTime}" xaxisColor="#666" xaxisTickSize="[3, 'month']" xaxisTickColor="#aaa" xaxisPosition="top" yaxisPosition="right" yaxisTickSize="10" cssStyle="width: 600px; height: 400px;" &gt; &lt;sjc:chartData id="chartAjaxData1" label="Map -Double, Double-" href="%{chartDataUrl}" // when i remove json call then it works fine list="dateFromMap" reloadTopics="reloadMap" lines="{show : true}" /&gt; &lt;/sjc:chart&gt; </code></pre> <p>struts.xml code</p> <pre><code> &lt;action name="jsonChartData" class="com.ebhasin.fitnessbliss.actions.GraphsAction"&gt; &lt;result type="json" name="success"&gt;&lt;/result&gt; &lt;/action&gt; </code></pre> <p>Action class code:</p> <pre><code>public class GraphsAction extends ActionSupport { private String currentDate; private Map&lt;Date, Float&gt; dateFromMap; HomeService homeService = new HomeService(); SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); @Override public String execute() { System.out.println("execute"); float weight; Date date = new Date(); Map session = ActionContext.getContext().getSession(); Integer loginId = (Integer) session.get("loginId"); if (loginId != null) { dateFromMap = new TreeMap&lt;Date, Float&gt;(); List list = homeService.getWeightGraphData(loginId); if (list.size() &gt; 0) { Iterator itr = list.iterator(); while (itr.hasNext()) { UserStats userStats = (UserStats) itr.next(); weight = userStats.getWeight(); date = userStats.getCreatedDate(); //currentDate = formatter.format(date); dateFromMap.put(date, weight); } } else { // dateFromMap.put("my",2F ); } } else { } return SUCCESS; } public String getCurrentDate() { return currentDate; } public void setCurrentDate(String currentDate) { this.currentDate = currentDate; } public Map&lt;Date, Float&gt; getDateFromMap() { return dateFromMap; } public void setDateFromMap(Map&lt;Date, Float&gt; dateFromMap) { this.dateFromMap = dateFromMap; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload