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
- <script type="text/javascript">
- var strArray = "[['sfdsdfLi', 9],['Kiwsdfi', 3],['Mixesdfd nuts', 1],['Oranges', 6],['Grapes (bunch)', 1]]";
-
- $(function () {
- $('[id*=search_data]').on('click', function () {
- var from = $('[id*=fromdate]').val();
- var to = $('[id*=todate]').val();
- var reg = $('[id*=regiondrop] option:selected')[0].value;
- var obj = {};
- obj.fdate = from;
- obj.tdate = to;
- obj.region = reg;
- GetData(obj);
- return false;
- });
- });
- function GetData(obj) {
- $.ajax({
- type: "POST",
- contentType: "application/json; charset=utf-8",
- url: "WebForm1.aspx/GetVo",
- data: JSON.stringify(obj),
- dataType: "json",
- success: function (result) {
-
- alert(result.d);
- alert('u');
-
- strArray = result.d;
- var myarray = eval(strArray);
- drawchar(myarray)
-
- $('#containerr').highcharts({
- chart: {
- type: 'pie',
- options3d: {
- enabled: true,
- alpha: 45
- }
- },
- title: {
- text: 'Contents of Highsoft\'s weekly fruit delivery'
- },
- subtitle: {
- text: '3D donut in Highcharts'
- },
- plotOptions: {
- pie: {
- innerSize: 100,
- depth: 45
- }
- },
- series: [{
- name: 'Delivered amount',
- data: myarray
- }]
- });
- },
- error: function (Result) {
- alert("Error");
- }
- });
- }
- </script>
return data is
- [['DPSB',1],['mv',11],['PSB',8]]