protected void Page_Load(object sender, EventArgs e) { Literal2.Text = CreatChart(); Literal1.Text = Creatpie(); } public string CreatChart() { string strXML; strXML = ""; strXML += "<graph caption='Unit Sales' xAxisName='Month' yAxisName='Units' showValues='1' decimals='0' formatNumberScale='0' useRoundEdges='1'>"; strXML += "<set label='Jan' value='462'/>"; strXML += "<set label='Feb' value='857'/>"; strXML += "<set label='Mar' value='671'/>"; strXML += "<set label='Apr' value='494'/>"; strXML += "<set label='May' value='761'/>"; strXML += "<set label='Jun' value='960'/>"; strXML += "</graph>"; return FusionCharts.RenderChart("FusionCharts/Column2D.swf", "", strXML, "myNext", "600", "300", false, false); } public string Creatpie() { string strXML; strXML = ""; strXML += "<graph caption='Unit Sales' xAxisName='Month' yAxisName='Units' showValues='1' decimals='0' formatNumberScale='0' useRoundEdges='1'>"; strXML += "<set label='Jan' value='450'/>"; strXML += "<set label='Feb' value='800'/>"; strXML += "<set label='Mar' value='654'/>"; strXML += "<set label='Apr' value='400'/>"; strXML += "<set label='May' value='750'/>"; strXML += "<set label='Jun' value='100'/>"; strXML += "</graph>"; return FusionCharts.RenderChart("FusionCharts/Column2D.swf", "", strXML, "myNext", "600", "300", false, false); } }
代码上