MYASP-fusionChart报表源代码(包能运行)
5星 · 超过95%的资源 需积分: 0 107 浏览量
更新于2012-05-29
收藏 6.52MB RAR 举报
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using InfoSoftGlobal;
using System.Text;
using System.Data.SqlClient;
using System.Data;
namespace MYASP
{
/// <summary>
/// Author:jilongliang
/// </summary>
public partial class index : System.Web.UI.Page
{
protected void Page_Load (object sender, EventArgs e)
{
}
/// <summary>
/// 直接在控件加载出来
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Literal1_Load (object sender, EventArgs e)
{
Literal1.Text = FusionCharts.RenderChart("swf/ScrollCombiDY2D.swf",
"fusioncharts.xml", "", "fusioncharts1", "500", "500", false, true);
}
/// <summary>
/// 用户输入显示的图形fusioncharts
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSubmit_Click (object sender, EventArgs e)
{
//Request.Form()
//Label1.Text = Request["ponit1"];
StringBuilder xmlData = new StringBuilder();
xmlData.Append("<chart caption='报表' subCaption='报表' showPercentValues='1' pieSliceDepth='30' showBorder='1'>");
xmlData.AppendFormat("<set label='Java' value='{0}' />", txtPoint1.Text); //txtPoint1.Text
xmlData.AppendFormat("<set label='asp.net' value='{0}' />", txtPoint2.Text);
xmlData.AppendFormat("<set label='C++' value='{0}' />", txtPoint3.Text);
xmlData.AppendFormat("<set label='Android' value='{0}' />", txtPoint4.Text);
xmlData.Append("</chart>");
Literal1.Text = FusionCharts.RenderChart("swf/Pie3D.swf", "", xmlData.ToString(), "fusioncharts2", "800", "500", false, false);
}
/// <summary>
/// 从数据库读数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Literal2_Load (object sender, EventArgs e)
{
string query = "select Team ,Points from tb_charts";
StringBuilder xmlData = new StringBuilder();
using(SqlDataReader dr = SQLDBHelper.ExecuteReader(CommandType.Text, query, null))
{
//<chart caption='某公司部门报表数据显示' xAxisName='Teams' yAxisName='Points' showValues='0' formatNumberScale='0' showBorder='0'>
xmlData.AppendFormat("<chart caption='某公司报表数据显示'>");
while(dr.Read())
{
xmlData.AppendFormat("<set label='{0}' value='{1}'/>", dr ["Team"].ToString(), dr ["Points"].ToString());
}
xmlData.AppendFormat("</chart>");
Literal2.Text = FusionCharts.RenderChart("swf/Column3D.swf", "", xmlData.ToString(), "testChart", "500", "500", false, true);
}
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void test2_Click (object sender, EventArgs e)
{
string str1=Request ["ponit1"];
Label1.Text=str1;
StringBuilder xmlData = new StringBuilder();
xmlData.Append("<chart caption='报表' subCaption='报表' showPercentValues='1' pieSliceDepth='30' showBorder='1'>");
xmlData.AppendFormat("<set label='Java' value='{0}' />", txtPoint1.Text); //txtPoint1.Text
xmlData.AppendFormat("<set label='asp.net' value='{0}' />", txtPoint2.Text);
xmlData.AppendFormat("<set label='C++' value='{0}' />", txtPoint3.Text);
xmlData.AppendFormat("<set label='Android' value='{0}' />", txtPoint4.Text);
xmlData.Append("</chart>");
Literal1.Text = FusionCharts.RenderChart("swf/Pie3D.swf", "", xmlData.ToString(), "fusioncharts2", "800", "500", false, false);
}
protected void test2_Click1 (object sender, EventArgs e)
{
}
}
}
jilongliang
- 粉丝: 40
- 资源: 94
最新资源
- 基于Python+SQL Server的实验室管理系统python数据库管理系统
- 离线xml转json的html代码
- springboot学生综合测评系统 PPT
- 油雾分离器工程图机械结构设计图纸和其它技术资料和技术方案非常好100%好用.zip
- hadoop-大数据技术中的Hadoop架构与应用解析
- CH340系列PDF数据手册
- IMG_20241225_103252.jpg
- 批量调整表格的行高Python实现源代码(不存在多行合并)
- silvaco学习资料!
- 职工工资表接近满分作业包含所有源文件
- 不同操作系统上tomcat安装与配置教程指南
- 纯js实现国密算法:sm2,sm3,sm
- 安卓源码,安卓开发,跑步打卡项目app源码,包括源码和简单文档
- selenium自动化测试工具详解:核心组件、编程语言支持及应用场景
- 大数据架构初步规划与应用
- 代码审核管理规范1.0