zoukankan      html  css  js  c++  java
  • 用OFC画饼图

    前面讲了用open flash chart来画曲线图,这里把我用open flash chart 画饼图的例子贴出来和大家分享

     context.Response.ContentType = "text/plain";
                //context.Response.Write("Hello World");
                OFC.OFC chart = new OFC.OFC();
                chart.Title = new Title("Pie Chart");
    
                OFC.Pie pie = new OFC.Pie();
                Random random = new Random();
    
                List<PieValue> values = new List<PieValue>();
                List<string> labels = new List<string>();
                for (int i = 0; i < 3; i++)
                {
                    values.Add(new PieValue(random.NextDouble(), "Pie" + i));
                    labels.Add(i.ToString());
                }
                //values.Add(0.2);
                PieValue pieValue = new PieValue(10);
                pieValue.Click = "http://xiao-yifang.blogspot.com";
                values.Add(pieValue);
                pie.Values = values;
                pie.FontSize = 20;
                pie.Alpha = .5;
                PieAnimationSeries pieAnimationSeries = new PieAnimationSeries();
                pieAnimationSeries.Add(new PieAnimation("bounce", 5));
                pie.Animate = pieAnimationSeries;
                //pie.GradientFillMode = false;
    
                //pie.FillAlpha = 10;
    
                //pie.Colour = "#fff";
                pie.Colours = new string[] { "#ff9900", "#ff0000", "#6600cc" };
                pie.Tooltip = "#labels#,#val# of #total##percent# of 100%";
                chart.AddElement(pie);
                chart.Bgcolor = "#202020";
                string s = chart.ToPrettyString();
                context.Response.Clear();
                context.Response.CacheControl = "no-cache";
                context.Response.Write(s);
                context.Response.End();
    

  • 相关阅读:
    POJ 3009 Curling 2.0 简单DFS 好题
    POJ 3253 Fence Repair 贪心
    python_13 面向对象
    python_12 模块
    python练习题_04
    python_11 装饰器,闭包
    python练习题_03
    python_10 迭代器和生成器
    python_09 文件处理流程,文件操作方法
    python_08 函数式编程、高阶函数、map、filter、reduce函数、内置函数
  • 原文地址:https://www.cnblogs.com/_fyz/p/1886658.html
Copyright © 2011-2022 走看看