asp.net - how do you pull XML data from a C# file -
if have xml data in c# file, instead of using setxmlurl(/blah.blah.xml); retrieve xml information xml file, function or code need pull xml data c# file used in asp.net?
this code is:
mychart.setxmlurl("/controls/taskorder/tasksummary.asc/tasksummary.ascx.cs");
i rendering chart in setxmlurl(""); area data being read from. xml file this:
mychart.setxmlurl("data/data.xml");
but since xml data appended in c# file, can't use setxmlurl since not referencing xml directly.
here updated @ code behind:
public void setline3chart(dataset exdt) { stringbuilder xmldata = new stringbuilder(); xmldata.append("<chart caption='current period: total months: 12' chartbottommargin='8' charttopmargin='04' captionpadding='01' xaxisnamepadding='-20' yaxisnamepadding='05' chartrightmargin='20' showborder='0' yaxisname='' xaxisname='' numberprefix='$' formatnumberscale='0'>"); xmldata.append("<categories>"); xmldata.append("<category label='january'/>"); xmldata.append("<category label='february'/>"); xmldata.append("<category label='march'/>"); xmldata.append("<category label='april'/>"); xmldata.append("<category label='may'/>"); xmldata.append("<category label='june'/>"); xmldata.append("</categories>"); xmldata.append("<dataset seriesname='budget spent' >"); xmldata.append("<set value='3478'/>"); xmldata.append("<set value='2557'/>"); xmldata.append("<set value='5379'/>"); xmldata.append("<set value='4987'/>"); xmldata.append("<set value='1790'/>"); xmldata.append("<set value='6367'/>"); xmldata.append("</dataset>"); xmldata.append("<dataset seriesname='average spending' renderas='line'>"); xmldata.append("<set value='4375'/>"); xmldata.append("<set value='4675'/>"); xmldata.append("<set value='6354'/>"); xmldata.append("<set value='7648'/>"); xmldata.append("<set value='4578'/>"); xmldata.append("<set value='4763'/>"); xmldata.append("</dataset>"); xmldata.append("<styles>"); xmldata.append("<definition>"); xmldata.append("<style name='font_0' type='font' font='arial' size='12' color='666666' rightmargin='15' />"); xmldata.append("</definition>"); xmldata.append("<application>"); xmldata.append("<apply toobject='caption' styles='font_0'/>"); xmldata.append("</application>"); xmldata.append("</styles>"); xmldata.append("</chart>"); literal9.text = fusioncharts.renderchart("/dashboard/charts/mscombi2d.swf", "", xmldata.tostring(), "line3chart", "100%", "100%", false, false); }
this looks strange:
mychart.setxmlurl("/controls/taskorder/tasksummary.asc/tasksummary.ascx.cs");
you wrong. :-)
you must connect xml/json data url. so, create ashx handler provide xml/json data arguments , put url of handler script. take look, if there possibility give data fusionchart object javascript variable. may help.
here can see ashx handler sending xml data: c# change sitemap ashx xml (only data missing).
Comments
Post a Comment