开发者论坛

 找回密码
 注册 (请使用非IE浏览器)
查看: 4203|回复: 2

Chart控件,史上最简单最好用,求赞扬

[复制链接]

0

精华

84

贡献

130

赞扬

帖子
210
软币
2538
在线时间
438 小时
注册时间
2014-2-15
发表于 2015-1-11 13:27:27 | 显示全部楼层 |阅读模式
本帖最后由 人工智能 于 2015-1-23 20:27 编辑

我用过的最简单的C# WebChart控件,特别适合在嵌入式系统下使用。是在一个国外网站上见到的。感觉好的给个评分,谢谢。

<%@ Page Language="C#" %>
<%@ Register tagPrefix="Web" Namespace="WebChart" Assembly="WebChart" %>
<%@ Import Namespace="System.Drawing" %>
<script runat=server>
      private void Page_Load(object sender, System.EventArgs e) {
            ColumnChart chart = new ColumnChart();

            chart.Fill.Color = Color.FromArgb(50, Color.SteelBlue);
            chart.Line.Color = Color.SteelBlue;
            chart.Line.Width = 2;

            chart.Legend = "WebChart information";
            chart.Data.Add( new ChartPoint("Jan", 10) );
            chart.Data.Add( new ChartPoint("Feb", 20) );
            chart.Data.Add( new ChartPoint("Mar", 14) );
            chart.Data.Add( new ChartPoint("Apr", 30) );
            chart.Data.Add( new ChartPoint("May", 18) );
            chart.Data.Add( new ChartPoint("Jun", 7) );
            chart.Data.Add( new ChartPoint("Jul", 8) );
            chart.Data.Add( new ChartPoint("Aug", 18) );
            chart.Data.Add( new ChartPoint("Sep", 24) );
            chart.Data.Add( new ChartPoint("Oct", 30) );
            chart.Data.Add( new ChartPoint("Nov", 17) );
            chart.Data.Add( new ChartPoint("Dec", 5) );
            
            ConfigureColors();

            ChartControl1.Charts.Add(chart);
            ChartControl1.RedrawChart();
      }
    // Configure some colors for the Chart, this could be done declaratively also

      private void ConfigureColors() {
            ChartControl1.Background.Color = Color.FromArgb(75, Color.SteelBlue);
            ChartControl1.Background.Type = InteriorType.LinearGradient;
            ChartControl1.Background.ForeColor = Color.SteelBlue;
            ChartControl1.Background.EndPoint = new Point(500, 350) ;
            ChartControl1.Legend.Position = LegendPosition.Bottom;
            ChartControl1.Legend.Width = 40;

            ChartControl1.YAxisFont.ForeColor = Color.SteelBlue;
            ChartControl1.XAxisFont.ForeColor = Color.SteelBlue;
            
            ChartControl1.ChartTitle.Text = "WebChart Control Sample";
            ChartControl1.ChartTitle.ForeColor = Color.White;
      
            ChartControl1.Border.Color = Color.SteelBlue;
            ChartControl1.BorderStyle = BorderStyle.Ridge;
      }
</script>
<html>
<head><title>WebChart Sample</title></head>
<body>
      <Web:ChartControl Width="500" Height="350" id="ChartControl1" runat="Server" />
</body>
</html>
chartSample.Png sample2.png

优秀控件.rar

276.33 KB, 下载次数: 109

WebChart

评分

参与人数 2赞扬 +2 收起 理由
tristram + 1 感谢分享
mgnc + 1 感谢分享

查看全部评分

回复

使用道具 举报

0

精华

0

贡献

0

赞扬

帖子
2
软币
58
在线时间
0 小时
注册时间
2016-12-7
发表于 2016-12-7 16:47:11 | 显示全部楼层
文档好像打不开,请问设置成图二要什么属性?
回复

使用道具 举报

Archiver|手机版|小黑屋|开发者网 ( 苏ICP备08004430号-2 )
版权所有:南京韵文教育信息咨询有限公司

GMT+8, 2024-5-6 16:16

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表