Note that there are some explanatory texts on larger screens.

plurals
  1. POJqPlot BarChart not refreshing...Exception No Data to Plot
    text
    copied!<p>I have this code under two scenarios.One is on html load and the second is on dropdown item change.The page load scenario is the same code without the ajax call.The dropdown scenario is using Ajax call as described in the code below.<br> The Page load scenario doesn't give any errors and displays the barchart correctly. The dropwdown Ajax scenario is giving me this error " No data to Plot"</p> <pre><code> $.jqplot.config.enablePlugins = true; $("#CategoryList").change(function () { var url = '&lt;%= Url.Content("~/") %&gt;' + "Home/GetExpenseSummaryByMonthByCategoryID"; var ddlsource = $("#CategoryList").val(); $.getJSON(url, { CatID: ddlsource }, function (data) { var label = 'Test Control'; var ticksString = '&lt;%=((List&lt;TPS.PFM.Application.Contract.DataTransferObjects.BarChartDTO&gt;)ViewData["BarCharts"])[1].Ticks%&gt;'.split(','); data2[1] = new Array(); data3[1] = new Array(); $.each(data, function (index, optionData) { data2[1].push(optionData.Value); data3[1].push(optionData.Name); }); try { plot1 = $.jqplot('BarChartControl3', data2[1], { title: label, animate: true, seriesDefaults: { renderer: $.jqplot.BarRenderer, pointLabels: { show: true }, rendererOptions: { fillToZero: true } }, series: getLabels(data3[1]), legend: { show: true, placement: 'outsideGrid' }, axes: { xaxis: { renderer: $.jqplot.CategoryAxisRenderer, ticks: ticksString }, yaxis: { tickOptions: { formatString: 'Rs%d' } } } }); } catch (Err) { alert(Err.message); } }); }); </code></pre> <p>I am puzzled.Because the same code on page load is successfully showing barchart.But with ajax call it is not refreshing the barchart. After pusing data2 and data3 respectively,their exact contents on alerting are :- the data2[1] data is this :- 0,0,0,0,1000,0,0,0,0,0,2010,0 the data3[1] data is this :- Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec</p> <p>I have checked the ajax call.The data is successfully returning.</p>
 

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