本文介绍了如何绑定动态数组值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我想在高图表中动态获取数组值,

我创建了以下代码,在这里我从SharePoint列表中检索值,并根据该值我需要开发一个图,那么我该怎么做?

所以请帮我提供任何答案...

Hello ,

I want to take dynamically array value in High chart,

I have created following code , Here I am retrieving value from SharePoint list And according to that values I need to develop a graph So what I can do for That?

So Please help provide me any answer...

 ........Something Code above.......
    $().SPServices({
                operation: method,
                async: false,  //if you set this to true, you may get faster performance, but your order may not be accurate.
                listName: list,
                CAMLViewFields: fieldsToRead,
                  CAMLQuery: query,
                      //this basically means "do the following code when the call is complete"
                    completefunc: function (xData, Status) {
                        //this code iterates through every row of data returned from the web service call
                        $(xData.responseXML).SPFilterNode("z:row").each(function() {
    var Name = ($(this).attr("ows_Title"));
 var Salary = ($(this).attr("ows_Salary"));
 var iID=$(this).attr("ows_ID");


                            //call a function to add the data from the row to a table on the screen
                            AddRowToTable(Name ,Salary ,iID);



                        });
                    }
        });

}
 function AddRowToTable(Name ,Salary ,iID)
     {

         alert(Salary);

          $.getJSON("arr", function AddRowToTable(Name ,Salary ,iID) {
        $('#courseTable').highcharts({
           title: {
             text: 'Monthly Average Salary',
              x: -20 //center
           },
            subtitle: {
               text: '',
               x: -20
            },
            xAxis: {
               categories:[''+Name+'']
                         },
            yAxis: {


              title: {
                  text: 'Salary (RS)'
                },

                    plotLines: [{

                    value: 0,
                    width: 1,
                   color: '#808080'
               }]



            },
            tooltip: {
                valueSuffix: 'Rs'
            },


            legend: {
                layout: 'vertical',
                align: 'right',
                verticalAlign: 'middle',
               borderWidth: 1
            },

            series: [{

              name: [''+Name+''],
              data: JSON.parse("[" + Salary+ "]")

                     }]
       });
       });
    };

</script>



请使用代码格式.谢谢你. Maciej Los [/EDIT]



Please, use code formatting. Thank you. Maciej Los[/EDIT]

推荐答案




这篇关于如何绑定动态数组值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 05:30