angularjs - nvd3 line with focus chart date range of the slider is mismatching with the main chart date range -
please see attached screen shot nvd3 line focus chart. date range have selected in slider not matching date range appearing in main chart. there bug in nvd3 line focus chart or doing mistake?
the following service return data controller :
angular.module('myapp').service( 'dashboardsdataservice', function() { this.getnetspendovertimedata = function(selectedaccount, carrieslist, fdate, tdate) { var selectedcarriers = null; if (carrieslist == null) { alert("please select carriers filters."); return false; } var selectedaccountid = selectedaccount.value; var selectedacctd = null; var prefixforselectedaccount = selectedaccountid.substr(0, 2); if (prefixforselectedaccount = "cu") { selectedcustomerid = selectedaccountid.replace("cu", ""); selectedcustomerid = selectedcustomerid.trim(); selectedacctd = selectedcustomerid; } else { if (prefixforselectedaccount = "sg") { selectedshippergroup = selectedaccountid.replace("sg", ""); selectedshippergroup = selectedshippergroup.trim(); selectedacctd = selectedshippergroup; } } (var = 0; < carrieslist.length; i++) { if (selectedcarriers !== null || typeof selectedcarriers !== "undefined" || selectedcarriers !== '') { selectedcarriers = selectedcarriers + "," + carrieslist[i].catgid; } else { selectedcarriers = carrieslist[i].catgid; } } var formattedfromdate = this.convertdateobjtostringformat(fdate); var formattedtodate = this.convertdateobjtostringformat(tdate); var originalrequest = $.ajax({ async : false, url : "/dash/dashboard2ajax.do", type : "post", data : { action : 'getnetspendovertime', customerid : selectedacctd, carriersid : selectedcarriers, fromdate : formattedfromdate, todate : formattedtodate }, datatype : "json", success : function(originalrequest) { var res = originalrequest; data = res.resultset.response; // alert("data" + data); } }); /* data = [ { "values": [ { "series": 0, "y": 1181, "x": 1391299200000 }, { "series": 0, "y": 1183, "x": 1391385600000 }, { "series": 0, "y": 977, "x": 1391472000000 }, { "series": 0, "y": 1136, "x": 1391558400000 }, { "series": 0, "y": 994, "x": 1391644800000 }, { "series": 0, "y": 944, "x": 1391731200000 }, { "series": 0, "y": 568, "x": 1391817600000 }, { "series": 0, "y": 1025, "x": 1391904000000 }, { "series": 0, "y": 1314, "x": 1391990400000 }, { "series": 0, "y": 882, "x": 1392076800000 }, { "series": 0, "y": 1160, "x": 1392163200000 }, { "series": 0, "y": 1143, "x": 1392249600000 }, { "series": 0, "y": 1048, "x": 1392336000000 }, { "series": 0, "y": 752, "x": 1392422400000 }, { "series": 0, "y": 753, "x": 1392508800000 }, { "series": 0, "y": 972, "x": 1392595200000 }, { "series": 0, "y": 1027, "x": 1392681600000 }, { "series": 0, "y": 1176, "x": 1392768000000 }, { "series": 0, "y": 1689, "x": 1392854400000 }, { "series": 0, "y": 1188, "x": 1392940800000 }, { "series": 0, "y": 897, "x": 1393027200000 }, { "series": 0, "y": 2579, "x": 1393200000000 }, { "series": 0, "y": 1212, "x": 1393286400000 }, { "series": 0, "y": 1324, "x": 1393372800000 }, { "series": 0, "y": 1476, "x": 1393459200000 }, { "series": 0, "y": 1036, "x": 1393545600000 }, { "series": 0, "y": 923, "x": 1393632000000 }, { "series": 0, "y": 1587, "x": 1393718400000 }, { "series": 0, "y": 285, "x": 1393804800000 }, { "series": 0, "y": 1809, "x": 1393891200000 }, { "series": 0, "y": 1742, "x": 1393977600000 }, { "series": 0, "y": 2233, "x": 1394064000000 }, { "series": 0, "y": 761, "x": 1394150400000 }, { "series": 0, "y": 2727, "x": 1394323200000 }, { "series": 0, "y": 1214, "x": 1394409600000 }, { "series": 0, "y": 1664, "x": 1394496000000 }, { "series": 0, "y": 1790, "x": 1394582400000 }, { "series": 0, "y": 1496, "x": 1394668800000 }, { "series": 0, "y": 1291, "x": 1394755200000 }, { "series": 0, "y": 1428, "x": 1394841600000 }, { "series": 0, "y": 744, "x": 1394928000000 }, { "series": 0, "y": 1391, "x": 1395014400000 }, { "series": 0, "y": 1438, "x": 1395100800000 }, { "series": 0, "y": 1801, "x": 1395187200000 }, { "series": 0, "y": 1840, "x": 1395273600000 }, { "series": 0, "y": 931, "x": 1395360000000 }, { "series": 0, "y": 987, "x": 1395446400000 }, { "series": 0, "y": 1012, "x": 1395532800000 }, { "series": 0, "y": 1404, "x": 1395619200000 }, { "series": 0, "y": 1776, "x": 1395705600000 }, { "series": 0, "y": 1593, "x": 1395792000000 }, { "series": 0, "y": 1746, "x": 1395878400000 }, { "series": 0, "y": 1377, "x": 1395964800000 }, { "series": 0, "y": 991, "x": 1396051200000 }, { "series": 0, "y": 1036, "x": 1396137600000 }, { "series": 0, "y": 1239, "x": 1396220400000 }, { "series": 0, "y": 1482, "x": 1396306800000 }, { "series": 0, "y": 1533, "x": 1396393200000 }, { "series": 0, "y": 1558, "x": 1396479600000 }, { "series": 0, "y": 1267, "x": 1396566000000 }, { "series": 0, "y": 1463, "x": 1396652400000 }, { "series": 0, "y": 1339, "x": 1396738800000 }, { "series": 0, "y": 1482, "x": 1396825200000 }, { "series": 0, "y": 2011, "x": 1396911600000 }, { "series": 0, "y": 1836, "x": 1396998000000 }, { "series": 0, "y": 2090, "x": 1397084400000 }, { "series": 0, "y": 1531, "x": 1397170800000 }, { "series": 0, "y": 906, "x": 1397257200000 }, { "series": 0, "y": 1207, "x": 1397343600000 }, { "series": 0, "y": 1860, "x": 1397430000000 }, { "series": 0, "y": 1276, "x": 1397516400000 }, { "series": 0, "y": 1802, "x": 1397602800000 }, { "series": 0, "y": 1808, "x": 1397689200000 }, { "series": 0, "y": 1647, "x": 1397775600000 }, { "series": 0, "y": 609, "x": 1397862000000 }, { "series": 0, "y": 1820, "x": 1397948400000 }, { "series": 0, "y": 1379, "x": 1398034800000 }, { "series": 0, "y": 1801, "x": 1398121200000 }, { "series": 0, "y": 1894, "x": 1398207600000 }, { "series": 0, "y": 1533, "x": 1398294000000 }, { "series": 0, "y": 925, "x": 1398380400000 }, { "series": 0, "y": 860, "x": 1398466800000 }, { "series": 0, "y": 977, "x": 1398553200000 }, { "series": 0, "y": 1373, "x": 1398639600000 }, { "series": 0, "y": 1557, "x": 1398726000000 }, { "series": 0, "y": 1245, "x": 1398812400000 }, { "series": 0, "y": 1538, "x": 1398898800000 }, { "series": 0, "y": 1321, "x": 1398985200000 }, { "series": 0, "y": 698, "x": 1399071600000 }, { "series": 0, "y": 1035, "x": 1399158000000 }, { "series": 0, "y": 1542, "x": 1399244400000 }, { "series": 0, "y": 1613, "x": 1399330800000 }, { "series": 0, "y": 1695, "x": 1399417200000 }, { "series": 0, "y": 1742, "x": 1399503600000 }, { "series": 0, "y": 1336, "x": 1399590000000 }, { "series": 0, "y": 617, "x": 1399676400000 }, { "series": 0, "y": 790, "x": 1399762800000 }, { "series": 0, "y": 1589, "x": 1399849200000 }, { "series": 0, "y": 1236, "x": 1399935600000 } ], "key": "usps" } ]; */ return data; } });
the following code in controller :
$scope.netspendovertime_data = dashboardsdataservice.getnetspendovertimedata(selectedaccount, selectedcarrierlist, fromdate, todate);
in jsp page, full json data being displayed ajax request, when have displayed using :
<div> <pre class="code">{{ netspendovertime_data | json }}</pre> </div>
Comments
Post a Comment