OpenFlashChart之折线图开发

OpenFlashChart之折线图开发

新建开发ASP.NET应用程序:OFCDemo

引用OFC类库。

ofcLib 

 

新建展示页面:Line.aspx

写布局控件

   <ofc:Chart ID="ofcLine" runat="server" Url="../data/linedata.aspx" Width="400px" Height="400px"/>

其中Url 为数据源所在的页面。

然后编写数据源页面:linedata.aspx

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OpenFlashChart;

public partial class data_linedata : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Graph graph = new Graph();
        //图表名,字体,字体颜色。
        graph.LegendX = new LegendX("折线图", 12, "#000000");
        //y轴的步长
        graph.StepsY = 20;
        //y轴的最大值
        graph.MaxY = 100;
        //构造报表数据
        OpenFlashChart.Charts.ChartData temp;
        // 摘要:
        //     Creates an instance of the AreaHollow object.
        //
        // 参数:
        //   width:
        //     线的宽度
        //
        //   dotsize:
        //     点的宽度
        //
        //   折线的颜色:
        //    折线的颜色十六进制值
        //
        //   alpha:
        //    线下区域的透明度
        //
        //   text:
        //     统计线说明的文本字符串.
        //
        //   fontsize:
        //     统计线说明字体的大小.
        //
        //   填充颜色:
        //    折线下面填充的颜色十六进制值
        temp = new OpenFlashChart.Charts.AreaHollow(4, 5, "#000000", 10, "1月业绩(万元)", 12, "#000000");
        //加点值
        temp.Data.Add(20);
        temp.Data.Add(30);
        temp.Data.Add(40);
        temp.Data.Add(10);
        temp.Data.Add(80);
        temp.Data.Add(0);
        temp.Data.Add(100);

        graph.Data.Add(temp);
        //输出数据
        Response.Clear();
        Response.Write(graph.ToString());
        Response.End();
    }
}

编译运行即可。

转载于:https://www.cnblogs.com/valensoft/archive/2010/04/13/1711458.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值