前面讲了用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();

相关文章:

  • 2021-12-31
  • 2021-10-18
  • 2022-01-15
  • 2021-11-07
  • 2022-12-23
  • 2021-05-25
  • 2021-09-27
猜你喜欢
  • 2021-12-14
  • 2021-06-22
  • 2021-09-24
  • 2022-01-05
  • 2021-12-31
相关资源
相似解决方案