Sign in to follow this  
sami.khan

Calculation issue while retreiving data from SharePoint List?:

Recommended Posts

Hi All,

I am facing a strang type of issue....I have a SharePoint List columns of number type in which some numbers are stored..The numbers are in the sequence as shown in the following fig: Note the  last column in the fig please:

7e147605-eb7c-4d8b-9a91-5b19.png

When i calulate the total of the last column "Num-Effectiviness of the Instructor" the chart is displayed as shown in the following fig:

2bea7b9e-c105-49f2-afbd-7aac.png 

as you can find from the fig: the total should be 11% not this garbage value. Here is my javascript code which is being used to display this chart..I am passing strXML to SetDataXML() method .

<script type="text/javascript">

var x=0;

var i=0;

var totalEffectiviness=0;

var Avg=0.0;

var AvgE=0;

var ID=0;

var Total=0;

var TotalValue=0;

var found=false;

var myData=new Array();

var Effectiviness=0;

var strXML="<chart caption='Overall Course Chart' xAxisName='Parameters' yAxisName='Percentage'  showValues='1' numberSuffix='%' yAxisMinValue ='0' yAxisMaxValue='100'>";

 

Effectiviness="<%Num - Effectiveness of the instructor%>";

if(!found)

{

myData=new Array();

myData=Effectiviness;

i++;

}

found=false;

TotalValue=myData.length;

for(x=0;x<TotalValue;x++)

{

Total =Total + myData[x];

}

strXML=strXML+"<set label='Effectiveness' value='"+Total+"' />";

strXML=strXML+"</chart>";

</script>

 

Would anyone of you please suggest what is wrong with Javascript code that it is not displaying the proper result?

Thanks,

Sami.

Share this post


Link to post
Share on other sites
Guest Rajroop

Hi Sami,

 

We proudly announce the release of FusionCharts for SharePoint in beta. FusionCharts for SharePoint helps you create interactive & data-driven charts in SharePoint, without having to write a line of code. The charts are created using a wizard and can connect to various data sources such as SharePoint Lists, CSV, MS SQL, Oracle, Excel & BDC. You can add drill-down and export capabilities to each chart and configure both cosmetic and functional aspects.

 

 

You can download the fully-functional version from www.fusioncharts.com/sharepoint - we would love to have your feedback on this.

 

Please post your suggestions and any bugs as replies to the forum thread at:

FusionCharts for SharePoint beta impression

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this