布局文件源码

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Pie.aspx.cs" Inherits="OFCDemo.Pie" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form />
    
    </div>
    </form>
</body>
</html>

 数据页面

using System;
using OpenFlashChart;

namespace OFCDemo.data
{
    public partial class piedata : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Graph graph = new Graph();
            graph.Title = new Title("市场份额比例图", "{font-size: 14px;color: #505050;}");
            //定义饼图对象
            OpenFlashChart.Charts.Pie pie =
                new OpenFlashChart.Charts.Pie(60,"#505050","{font-size: 12px;color: #404040;");
           
            //定义一个份额
            OpenFlashChart.Charts.Pie.Piece piece;
            //赋值份额
            Random rd = new Random();
            for (int i = 1; i < 5; i++)
            {
                int red = rd.Next(256);
                int green = rd.Next(256);
                int blue = rd.Next(256);
                piece = new OpenFlashChart.Charts.Pie.Piece(rd.Next(1, 100),
                    string.Format("项目{0}", i), "#FF44FF");
                pie.Data.Add(piece);
            }
            graph.Pie = pie;
            //输出数据
            Response.Clear();
            Response.Write(graph.ToString());
            Response.End();
          
        }
    }
}

相关文章:

  • 2021-08-11
  • 2022-12-23
  • 2021-08-29
  • 2021-12-31
  • 2021-06-28
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
  • 2021-11-23
  • 2021-04-16
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案