彩票走势图

FusionCharts集成方法与同比环比使用案例

原创|其它|编辑:郝浩|2012-10-19 17:17:13.000|阅读 973 次

概述:集成FusionCharts图表,完成同比环比,文中附加源码

# 慧都年终大促·界面/图表报表/文档/IDE等千款热门软控件火热促销中 >>

集成FusionCharts图表,完成同比环比,如下文中的样式:

FusionCharts集成方法与同比环比使用案例

调用格式:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestFusion.aspx.cs" Inherits="Abis.Web.Examples.FusionChartsDemo.TestFusion" %>  
<%@ Register Src="~/Resources/Ascx/UCFusionCharts.ascx" TagName="UCFusionCharts" TagPrefix="ucFc" %>  
<!DOCTYPE html>  
  
<html xmlns="//www.w3.org/1999/xhtml">  
<head runat="server">  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>  
 <title></title>  
</head>  
<body>    <form id="form1" runat="server">  
<div>  
<ucFc:UCFusionCharts runat="server" ID="UCFusionCharts1" />  
</div>  
</form>  
</body>  
</html>  

CS文件:

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Abis.Web.Examples.FusionChartsDemo
{
    public partial class TestFusion : System.Web.UI.Page
    {
        Abis.Services.oa_Notice_UserLook Serveroa_Notice_UserLook = new Services.oa_Notice_UserLook();

        protected void Page_Load(object sender, EventArgs e)
        {
            #region 基本用法
            //DataTable dt = Serveroa_Notice_UserLook.GetDataTableAll();
            //UCFusionCharts1.Show("员工工时报表", dt, 3, 8, "FCF_Column3D.swf", "800", "500");
            #endregion

            //初始化
            ChartFun.ModelCharts ModelChartsTemp = new ChartFun.ModelCharts();
            List<ChartFun.ModelList> ListModelChartList = new List<ChartFun.ModelList>();
            //表设置
            ModelChartsTemp.caption = "测试一个报表";          //图表标题
            ModelChartsTemp.subCaption = "";    //副标题
            ModelChartsTemp.baseFontSize = "12";    //文字大小
            ModelChartsTemp.decimalPrecision = "0";                         //小数位数
            ModelChartsTemp.numberSuffix = "米";                         //后缀
            ModelChartsTemp.width = "800";
            ModelChartsTemp.height = "600";
            //ModelChartsTemp.xAxisName = "姓名";   //X轴名称
            //ModelChartsTemp.yAxisName = "abda 测试";   //Y轴名称

            //ModelChartsTemp.captionFontSize = "20";                         // 标题字体大小
            //ModelChartsTemp.xAxisNameFontSize = "14";                    //X轴文字字体大小
            //ModelChartsTemp.yAxisNameFontSize = "12";                    //Y轴文字字体大小
            //ModelChartsTemp.AngleXValue = 0;                           //X轴文字倾斜角度
            //ModelChartsTemp.AngleYValue = 0;                            //Y轴文字倾斜角度

            //表体
            //List<ChartFun.ModelChart> ListModelChart = new List<ChartFun.ModelChart>();
            //ListModelChart.Add(new ChartFun.ModelChart() { X = "小王0", Y = "40" });
            //ListModelChart.Add(new ChartFun.ModelChart() { X = "小王2", Y = "50" });
            //ListModelChart.Add(new ChartFun.ModelChart() { X = "小王3", Y = "60" });
            //ListModelChart.Add(new ChartFun.ModelChart() { X = "小王4", Y = "70" });

            List<ChartFun.ModelChart> ListModelChart = new List<ChartFun.ModelChart>();
            ListModelChart.Add(new ChartFun.ModelChart() { X = "小王0", Y = "40", Y0 = "50", Y1 = "60" });
            ListModelChart.Add(new ChartFun.ModelChart() { X = "小王2", Y = "40", Y0 = "50", Y1 = "60" });
            ListModelChart.Add(new ChartFun.ModelChart() { X = "小王3", Y = "40", Y0 = "50", Y1 = "60" });
            ListModelChart.Add(new ChartFun.ModelChart() { X = "小王4", Y = "40", Y0 = "50", Y1 = "60" });

            ChartFun.ModelList ModelListChart = new ChartFun.ModelList()
            {
                LegendTitleY = "本期",
                LegendColorY = "ff5858",
                LegendTitleY0 = "同比",
                LegendColorY0 = "0080ff",
                //LegendTitleY1 = "环比",
                //LegendColorY1 = "8000ff",
                ListModelChart = ListModelChart
            };

            UCFusionCharts1.ShowChartColumns3D(ModelChartsTemp, ModelListChart);
        }
    }
}

 


标签:

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@pclwef.cn

文章转载自:csdn

为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP