scropio gurl

scropio gurl

  • NA
  • 147
  • 96.9k

high chart according to date

Jun 28 2016 3:19 AM
HI ALL
i try to display pie chart according to date .. when i select value from drop-down and dates from calendar first i try to display data in alert box..
so data is successfully in alert box now i want data in pie chart i try this but chart not display
  1. <script type="text/javascript">  
  2. var strArray = "[['sfdsdfLi', 9],['Kiwsdfi', 3],['Mixesdfd nuts', 1],['Oranges', 6],['Grapes (bunch)', 1]]";  
  3.   
  4. $(function () {  
  5. $('[id*=search_data]').on('click'function () {  
  6. var from = $('[id*=fromdate]').val();  
  7. var to = $('[id*=todate]').val();  
  8. var reg = $('[id*=regiondrop] option:selected')[0].value;  
  9. var obj = {};  
  10. obj.fdate = from;  
  11. obj.tdate = to;  
  12. obj.region = reg;  
  13. GetData(obj);  
  14. return false;  
  15. });  
  16. });  
  17. function GetData(obj) {  
  18. $.ajax({  
  19. type: "POST",  
  20. contentType: "application/json; charset=utf-8",  
  21. url: "WebForm1.aspx/GetVo",  
  22. data: JSON.stringify(obj),  
  23. dataType: "json",  
  24. success: function (result) {  
  25.   
  26. alert(result.d);  
  27. alert('u');  
  28. //start  
  29. strArray = result.d;  
  30. var myarray = eval(strArray);  
  31. drawchar(myarray)  
  32.   
  33. $('#containerr').highcharts({  
  34. chart: {  
  35. type: 'pie',  
  36. options3d: {  
  37. enabled: true,  
  38. alpha: 45  
  39. }  
  40. },  
  41. title: {  
  42. text: 'Contents of Highsoft\'s weekly fruit delivery'  
  43. },  
  44. subtitle: {  
  45. text: '3D donut in Highcharts'  
  46. },  
  47. plotOptions: {  
  48. pie: {  
  49. innerSize: 100,  
  50. depth: 45  
  51. }  
  52. },  
  53. series: [{  
  54. name: 'Delivered amount',  
  55. data: myarray  
  56. }]  
  57. });  
  58. },  
  59. error: function (Result) {  
  60. alert("Error");  
  61. }  
  62. });  
  63. }  
  64. </script>  
 return data is
  1. [['DPSB',1],['mv',11],['PSB',8]]  

Answers (4)