Javascript XML issue
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Javascript XML issue Expand / Collapse
Author
Message
Posted 7/2/2007 5:45:43 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 1/30/2008 4:27:43 PM
Posts: 3, Visits: 5
Hello,

I'm trying to modify this file given as demo. Everything works good but what I want is change the colors of the datasets.

I know how to do this in a simple xml file but in this page, the xml is generated by the javascript.
What I simply want to do is change the color of the line of one dataset:


//Based on the products for which we've to generate data, generate XML
strXML = (this.document.productSelector.PointsF.checked==true)?(strXML + getProductXML(0))strXML)+ (" color='FF0000' ");
strXML = (this.document.productSelector.PointsA.checked==true)?(strXML + getProductXML(1))strXML);
strXML = (this.document.productSelector.Rebounds.checked==true)?(strXML + getProductXML(2))strXML);
strXML = (this.document.productSelector.Assists.checked==true)?(strXML + getProductXML(3))strXML);
strXML = (this.document.productSelector.Steals.checked==true)?(strXML + getProductXML(4))strXML);

//Close element;
strXML = strXML + "
";

//Return data
return strXML;
}

/**
* getProductXML method returns the and elements XML for
* a particular product index (in data array).
* @param productIndex Product index (in data array)
* @return XML Data for the product.
*/
function getProductXML(productIndex){
var productXML;
//Create element
productXML = "";
//Create set elements
for (var i=1; i<=43; i++){
productXML = productXML + "";
}
//Close element
productXML = productXML + "
";
//Return
return productXML;
}


As you can see, I tried do to it like this:

strXML = (this.document.productSelector.PointsF.checked==true)?(strXML + getProductXML(0))strXML)+ (" color='FF0000' ");

In red you can see my try but that didnt work out, the html page is still valid but the colors are still random. Anyone that can teach me how to do it properly?


Post #1496
Posted 7/4/2007 11:41:10 AM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: 10/3/2008 2:42:18 AM
Posts: 2,117, Visits: 498
Can you please fwd me the XML output generated by your JS code - that'll be much easier for me to debug.

Thanks,
Pallav Nadhani
FusionCharts Team
Post #1514
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 5:31pm


Execution: 0.141.