Sign in to follow this  
vanna

Building Radar Chart Using Xml In Sharepoint 2010 Custom Form Web Part

Recommended Posts

hello,

im using radar chart v3 for sharepoint 2010, but im custom building them through XML in a webpart.

 

can you please give an example on how i can make a radar chart which can plot list values, using XML inside a web part?

 

ive tried making one but its not working, im confused with how can i plot values with relevant fields which are linked to relevant AXIS in my chart, ive seen radar chart help but its too basic as i dont want hardcoded values in my chart, the below code works and it makes a radar chart but i dont want the labels to be hard coded, the values plotted by the chart are also not correct, so basically "Title" and "Value" are connected to each other and i want to have a value which points to its title. thanks

 

script type="text/javascript">

var value=0;

var Title ="";

var found=false;

var x=0;

var i=0;

var myData=new Array();

 

var strXML = "<chart caption='Demo Chart' bgcolor='FFFFFF' anchoralpha='0' basefontcolor='3E3E3F' bordercolor='6FACD1' captionpadding='20' radarFillColor='FFFFFF'>";

 

strXML==strXML + "<categories>";

strXML=strXML + "<category label='Security'/>";

strXML=strXML + "<category label='Utilized'/>";

strXML=strXML + "<category label='Reliability'/>";

strXML=strXML + "<category label='Complexity'/>";

strXML=strXML + "<category label='Dependancy'/>";

strXML=strXML + "<category label='Maturity'/>";

strXML=strXML + "<category label='Criticality'/>";

strXML=strXML + "<category label='Compliance'/>";

 

 

strXML=strXML + "</categories>";

 

value="<%Value%>";

Title="<%Title%>";

 

if(!found)

{

myData=new Array();

myData[0]=value;

myData[1]=Title;

i++;

}

found=false;

 

 

strXML=strXML + "<dataset seriesName='Value' color='68D740' >";

 

for(x in myData)

{

strXML=strXML + "<set value="+myData[x][1]/>";

strXML=strXML + "<set value = "+myData[x][0]/>";

}

strXML=strXML + "</dataset>";

strXML=strXML + "</chart>";

</script>

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