FusionCharts简介:
FusionCharts 是InfoSoft Global 公司的一个产品,InfoSoft Global 公司是专业的
Flash 图形方案提供商,他们还有几款其他的,基于Flash 技术的产品,都非常的漂亮。
FusionCharts Free 则是FusionCharts 提供的一个免费版本,虽然免费,功能依然强大,
图形类型依然丰富。(简单的理解就是3D动态图形报表,用起来直观,方便,漂亮)
我项目的效果图:
- if (!string.IsNullOrEmpty(Request.QueryString["type"]))
- {
- Response.Clear();
- string kssj = Request.QueryString["kssj"].ToString();
- string jssj = Request.QueryString["jssj"].ToString();
- string[] shuzu1 = GdShuJu(kssj, jssj);
- string st5 = shuzu1[0].ToString();
- // Response.Write(st5);
- string st6 = shuzu1[1].ToString();
- string st7 = shuzu1[2].ToString();
- //报表图画
- f1 = FusionCharts.RenderChartHTML("../../../Charts/FCF_Column3D.swf", "", st6.ToString(), "myNext", "900", "600", false);
- f2 = FusionCharts.RenderChartHTML("../../../Charts/FCF_Line.swf ", "", st6.ToString(), "myNext", "900", "600", false);
- f3 = FusionCharts.RenderChartHTML("../../../Charts/FCF_Pie3D.swf", "", st7.ToString(), "myNext", "900", "600", false);
- string[] shuzu2 = { st5, f1, f2, f3 };
- Response.Write(js.Serialize(shuzu2));
- //Response.Write();
- Response.End();
- }
- else
- {
- st1 = GdShuJu("", "")[0];
- string st3 = GdShuJu("", "")[1];
- string st4 = GdShuJu("", "")[2];
- //报表图画
- f1 = FusionCharts.RenderChartHTML("../../../Charts/FCF_Column3D.swf", "", st3.ToString(), "myNext", "900", "600", false);
- f2 = FusionCharts.RenderChartHTML("../../../Charts/FCF_Line.swf ", "", st3.ToString(), "myNext", "900", "600", false);
- f3 = FusionCharts.RenderChartHTML("../../../Charts/FCF_Pie3D.swf", "", st4.ToString(), "myNext", "900", "600", false);
- }
- }
- string[] GdShuJu(string time1, string time2)
- {
- //工单受理类的实例对象
- BLLTJ_QSFX qsfx = new BLLTJ_QSFX();
- DataTable dt = qsfx.YWSLTJSelect(time1, time2, 9);
- StringBuilder str = new StringBuilder();
- StringBuilder strXML = new StringBuilder();
- StringBuilder strXML1 = new StringBuilder();
- //创建xml数据对象
- strXML.Append("<graph caption='电话报装分类统计分析' xAxisName='数量' yAxisName='数量' decimalPrecision='0' formatNumberScale='0' baseFontSize='14' baseFont='宋体' >");
- strXML1.Append("<graph caption='电话报装分类统计分析图' xAxisName='数量' yAxisName='数量' decimalPrecision='0' formatNumberScale='0' baseFontSize='14' baseFont='宋体' >");
- //表
- str.Append("<table width='90%' border='1' align='center' cellpadding='4' cellspacing='0' style='border-collapse: collapse; ' class='TableBorderStyle'>");
- str.Append("<tr class='TableTRBgStyle'><td align='center' >电话报装分类</td> <td align='center'>数量</td></tr>");
- if (dt.Rows.Count > 0)
- {
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- str.AppendFormat("<tr><td align='center' style='width:50%'>{0}</td> <td align='center' style='width:50%'>{1}</td></tr>", dt.Rows[i]["MC"].ToString(), dt.Rows[i]["zs"].ToString());
- //柱状图和曲线图
- strXML.AppendFormat("<set name='{0}' value='{1}' color='{2}' />", dt.Rows[i]["MC"].ToString(), dt.Rows[i]["zs"].ToString(), yanse[i].ToString());
- //饼状图
- if (dt.Rows[i]["zs"].ToString() != "0")
- {
- strXML1.AppendFormat("<set name='{0}' value='{1}' color='{2}' />", dt.Rows[i]["MC"].ToString(), dt.Rows[i]["zs"].ToString(), yanse[i].ToString());
- }
- }
- }
- strXML.Append("</graph>");
- strXML1.Append("</graph>");
- str.Append("</table>");
- string[] st = { str.ToString(), strXML.ToString(), strXML1.ToString() };
- return st;
- }