2024年3月23日发(作者:)

CNET使用

DotNetCharting

件生成报表统计图

总结

1

资料内容仅供参考,如有不当或者侵权,请联系本人改正或者删除。

.NET使用DotNetCharting控件生成报表统计图总结

在做项目时要对数据进行统计分析, 因此必须生成一些报表统计图

(如柱形图、饼图、曲线图等), 网上强烈推荐了使用

DotNetCharting控件来实现, 于是自己对DotNetCharting控件进行

了简单的学习, 下面先简单介绍一下

用。

DotNetCharting控件及其使

DotNetCharting是一个非常棒的.NET图表控件, 对中文支持非常

好, 而且操作方便, 开发快速, 既有for webform 也有for winform的,

而且.net1.1和2.0都有支持。它的官方地址是

本站也提供了DotNetCharting破解版本下载: 附件:

( 下载36次)

强烈推荐一下DotNetCharting的demo地址:

这个是所有的 DEMO 演示

这个是 Online Documentation 里面会有详细的说明和用法。

DotNetCharting的简单使用方法:

1.把添加到工具箱, 而且添加引用;

2

资料内容仅供参考,如有不当或者侵权,请联系本人改正或者删除。

2.把控件拖到你的网页上, 然后添加引用using dotnetCHARTING;

就能够用了;

3.接下来是自己写的对DotNetCharting操作的封装类, 以便于在

程序里调用。

1.

using System;

2.

using ;

3.

using ;

4.

using dotnetCHARTING;

5.

6.

namespace xQuery

7.

{

8.

/**////

9.

/// 彭建军

10.

/// 根据数据动态生成图形( 柱形图、饼图、曲线图)

11.

/// -06-19

12.

///

13.

public class ShowData

14.

{

3

资料内容仅供参考,如有不当或者侵权,请联系本人改正或者删除。

15.

16.

属性#region 属性

17.

private string _phaysicalimagepath;//图片存放路径

18.

private string _title; //图片标题

19.

private string _xtitle;//图片x座标名称

20.

private string _ytitle;//图片y座标名称

21.

private string _seriesname;//图例名称

22.

private int _picwidth;//图片宽度

23.

private int _pichight;//图片高度

24.

private DataTable _dt;//图片数据源

25.

26.

/**////

27.

/// 图片存放路径

28.

///

29.

public string PhaysicalImagePath

30.

{

31.

set{_phaysicalimagepath=value;}

32.

get{return _phaysicalimagepath;}

33.

}

34.

/**////

35.

/// 图片标题

36.

///

37.

public string Title

4

资料内容仅供参考,如有不当或者侵权,请联系本人改正或者删除。

38.

{

39.

set{_title=value;}

40.

get{return _title;}

41.

}

42.

/**////

43.

/// 图片标题

44.

///

45.

public string XTitle

46.

{

47.

set{_xtitle=value;}

48.

get{return _xtitle;}

49.

}

50.

/**////

51.

/// 图片标题

52.

///

53.

public string YTitle

54.

{

55.

set{_ytitle=value;}

56.

get{return _ytitle;}

57.

}

58.

59.

/**////

60.

/// 图例名称

5

资料内容仅供参考,如有不当或者侵权,请联系本人改正或者删除。

61.

///

62.

public string SeriesName

63.

{

64.

set{_seriesname=value;}

65.

get{return _seriesname;}

66.

}

67.

/**////

68.

/// 图片宽度

69.

///

70.

public int PicWidth

71.

{

72.

set{_picwidth=value;}

73.

get{return _picwidth;}

74.

}

75.

/**////

76.

/// 图片高度

77.

///

78.

public int PicHight

79.

{

80.

set{_pichight=value;}

81.

get{return _pichight;}

82.

}

6

资料内容仅供参考,如有不当或者侵权,请联系本人改正或者删除。

83.

/**////

84.

/// 图片数据源

85.

///

86.

public DataTable DataSource

87.

{

88.

set{_dt=value; }

89.

get{return _dt;}

90.

}

91.

#endregion

92.

93.

构造函数#region 构造函数

94.

public ShowData()

95.

{

96.

//

97.

// TODO: 在此处添加构造函数逻辑

98.

//

99.

}

100.

101.

public ShowData(string PhaysicalImagePath,string

Title,string XTitle,string YTitle,string SeriesName)

102.

{

103.

_phaysicalimagepath=PhaysicalImagePath;

104.

_title=Title;

7

资料内容仅供参考,如有不当或者侵权,请联系本人改正或者删除。

105.

_xtitle=XTitle;

106.

_ytitle=YTitle;

107.

_seriesname=SeriesName;

108.

}

109.

#endregion

110.

111.

输出柱形图#region 输出柱形图

112.

/**////

113.

/// 柱形图

114.

///

115.

///

116.

public void CreateColumn(

chart)

117.

{

118.

=this._title;

119.

=this._xtitle;

120.

=this._ytitle;

121.

rectory

=this._phaysicalimagepath;

122.

= this._picwidth;

123.

= this._pichight;

124.

= ;

125.

=er;

8