Can I load legend from xml file to line chart?

Hi,

My problem is that I receive from server xml file with line chart values, something like:


90.25
29.78
42.33
24.49
0 2/8


91.83
30.14
45.96
27.59
1 2/8

but I need receive description for row1, row2, row3… too, that means legend, like:

chartObj.define(“legend”,{
values:[
{text:“1-2”,color:“#0000FF”},
{text:“1-22”,color:“#FF00FF”},
{text:“2-1”,color:“#FFFF00”},
{text:“2-2”,color:“#33CCCC”}]
})
I must do that because only on server I now what is row1 description and I must send that information to client app in that xml file.

You may load legend json by dhtmlxAjax, convert it to the json object and pass to define method:

[code]dhtmlxAjax.get(url,setLegend);

function setLegend(loader){
var data;
if(loader.xmlDoc.responseXML!=null){
eval(“data=”+loader.xmlDoc.responseText+";");
chartObj.define(“legend”,data);
}
}[/code]

docs.dhtmlx.com/doku.php?id=dhtm … dhtmlxajax

the sample is dhtmlxAjax/samples/01_samples_of_usage/01_send_request.html ( dhtmlx.com/docs/products/dht … quest.html )