统计图形种类繁多, 有柱状图, 折线图, 扇形图等等, 而统计图形的绘制方法也有很多, 有Flash制作的统计图形, 有水晶报表生成统计图形, 有专门制图软件制作, 也有编程语言自己制作的;这里我们用就C# 制作三款最经典的统计图: 柱状图, 折线图和扇形图;既然是统计, 当然需要数据, 这里演示的数据存于Sql Server2000中, 三款统计图形都是动态生成. 其中柱状图我会附上制作步骤, 其他两款统计图直接附源码.

说明: 需求不一样, 统计图形绘制后的显示效果也不一样, 比如这里柱状图的主要需求是为了比较每一期报名人数与通过人数的差, 因此会把两根柱子放在一起会使比较结果一目了然. 因此大家可以根据需要灵活绘制.

一. 柱状图的绘制.

绘制步骤如下:

1. 定义绘图用到的类.

int height = , width = ;
Bitmap image = new Bitmap(width, height);
Graphics g = Graphics.FromImage(image);
Pen mypen = new Pen(brush, );

2. 绘制图框.

g.FillRectangle(Brushes.WhiteSmoke, , , width, height);

3. 绘制横向坐标线

for (int i = ; i < ; i++)
{
g.DrawLine(mypen, x, , x, );
x = x + ;
}

4. 绘制纵向坐标线

for (int i = ; i < ; i++)
{
g.DrawLine(mypen, , y, , y);
y = y + ;
}

5. 绘制横坐标值

String[] n = { "第一期", "第二期", "第三期", "第四期", "全年" };
for (int i = ; i < ; i++)
{
g.DrawString(n[i].ToString(), font, Brushes.Blue, x, );
x = x + ;
}

6. 绘制纵坐标值

String[] m = {"","", "", "", "", "", "100“};
for (int i = ; i < ; i++)
{
g.DrawString(m[i].ToString(), font, Brushes.Blue, , y);
y = y + ;
}

7. 定义数组存储数据库中统计的数据

int[] Count1 = new int[]; //存储从数据库读取的报名人数
int[] Count2 = new int[]; //存储从数据库读取的通过人数

8. 从数据库中读取报名人数与通过人数

SqlConnection Con = new SqlConnection(
"Server=(Local);Database=committeeTraining;");
Con.Open();
string cmdtxt2 = "SELECT * FROM ##Count
where Company='" + ****+ "'";
SqlDataAdapter da = new SqlDataAdapter(cmdtxt2, Con);
DataSet ds = new DataSet();
da.Fill(ds);

9. 将读取的数据存储到数组中

Count1[] = Convert.ToInt32(ds.Tables[].Rows[][“count1”].ToString());
Count1[] = Convert.ToInt32(ds.Tables[].Rows[][“count3”].ToString());
Count2[] = Convert.ToInt32(ds.Tables[].Rows[][“count2”].ToString());
Count2[] = Convert.ToInt32(ds.Tables[].Rows[]["count4"].ToString());

10.定义画笔和画刷准备绘图

x = ;
Font font2 = new System.Drawing.Font(
"Arial", , FontStyle.Bold);
SolidBrush mybrush = new SolidBrush(Color.Red);
SolidBrush mybrush2 = new SolidBrush(Color.Green);

11. 根据数组中的值绘制柱状图

()第一期报名人数
g.FillRectangle(mybrush, x, - Count1[], , Count1[]);
g.DrawString(Count1[].ToString(), font2,
Brushes.Red, x, - Count1[] - ); () 第一期通过人数
x = x + ;
g.FillRectangle(mybrush2, x, - Count2[], , Count2[]);
g.DrawString(Count2[].ToString(), font2,
Brushes.Green, x, - Count2[] - );

12. 将图形输出到页面.

System.IO.MemoryStream ms = new
System.IO.MemoryStream();
image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
Response.ClearContent();
Response.ContentType = "image/Jpeg";
Response.BinaryWrite(ms.ToArray());

最终柱状图的效果图:

柱状图的完整代码:

private void CreateImage()
{
int height = , width = ;
Bitmap image = new Bitmap(width, height);
//创建Graphics类对象
Graphics g = Graphics.FromImage(image); try
{
//清空图片背景色
g.Clear(Color.White); Font font = new Font("Arial", , FontStyle.Regular);
Font font1 = new Font("宋体", , FontStyle.Bold); LinearGradientBrush brush = new LinearGradientBrush(new Rectangle(, , image.Width, image.Height),
Color.Blue, Color.BlueViolet, 1.2f, true);
g.FillRectangle(Brushes.WhiteSmoke, , , width, height);
// Brush brush1 = new SolidBrush(Color.Blue); g.DrawString(this.ddlTaget.SelectedItem.Text + " " + this.ddlYear.SelectedItem.Text +
" 成绩统计柱状图", font1, brush, new PointF(, ));
//画图片的边框线
g.DrawRectangle(new Pen(Color.Blue), , , image.Width - , image.Height - ); Pen mypen = new Pen(brush, );
//绘制线条
//绘制横向线条
int x = ;
for (int i = ; i < ; i++)
{
g.DrawLine(mypen, x, , x, );
x = x + ;
}
Pen mypen1 = new Pen(Color.Blue, );
x = ;
g.DrawLine(mypen1, x, , x, ); //绘制纵向线条
int y = ;
for (int i = ; i < ; i++)
{
g.DrawLine(mypen, , y, , y);
y = y + ;
}
g.DrawLine(mypen1, , y, , y); //x轴
String[] n = { "第一期", "第二期", "第三期", "第四期", "上半年", "下半年", "全年统计" };
x = ;
for (int i = ; i < ; i++)
{
g.DrawString(n[i].ToString(), font, Brushes.Blue, x, ); //设置文字内容及输出位置
x = x + ;
} //y轴
String[] m = {"","", "", "", "", "", "", "",
"", "", ""};
y = ;
for (int i = ; i < ; i++)
{
g.DrawString(m[i].ToString(), font, Brushes.Blue, , y); //设置文字内容及输出位置
y = y + ;
} int[] Count1 = new int[];
int[] Count2 = new int[]; SqlConnection Con = new SqlConnection("Server=(Local);Database=committeeTraining;Uid=sa;Pwd=**");
Con.Open();
string cmdtxt2 = "SELECT * FROM ##Count where Company='" + this.ddlTaget.SelectedItem.Text.Trim() + "'";
SqlDataAdapter da = new SqlDataAdapter(cmdtxt2, Con);
DataSet ds = new DataSet();
da.Fill(ds); Count1[] = Convert.ToInt32(ds.Tables[].Rows[]["count1"].ToString());
Count1[] = Convert.ToInt32(ds.Tables[].Rows[]["count3"].ToString());
Count1[] = Convert.ToInt32(ds.Tables[].Rows[]["count5"].ToString());
Count1[] = Convert.ToInt32(ds.Tables[].Rows[]["count7"].ToString()); Count1[] = Count1[] + Count1[];
Count1[] = Count1[] + Count1[]; Count1[] = Convert.ToInt32(ds.Tables[].Rows[]["count9"].ToString()); Count2[] = Convert.ToInt32(ds.Tables[].Rows[]["count2"].ToString());
Count2[] = Convert.ToInt32(ds.Tables[].Rows[]["count4"].ToString());
Count2[] = Convert.ToInt32(ds.Tables[].Rows[]["count6"].ToString());
Count2[] = Convert.ToInt32(ds.Tables[].Rows[]["count8"].ToString()); Count2[] = Count2[] + Count2[];
Count2[] = Count2[] + Count2[]; Count2[] = Convert.ToInt32(ds.Tables[].Rows[]["count10"].ToString()); //绘制柱状图.
x = ;
Font font2 = new System.Drawing.Font("Arial", , FontStyle.Bold);
SolidBrush mybrush = new SolidBrush(Color.Red);
SolidBrush mybrush2 = new SolidBrush(Color.Green); //第一期
g.FillRectangle(mybrush, x, - Count1[], , Count1[]);
g.DrawString(Count1[].ToString(), font2, Brushes.Red, x, - Count1[] - ); x = x + ;
g.FillRectangle(mybrush2, x, - Count2[], , Count2[]);
g.DrawString(Count2[].ToString(), font2, Brushes.Green, x, - Count2[] - ); //第二期
x = x + ;
g.FillRectangle(mybrush, x, - Count1[], , Count1[]);
g.DrawString(Count1[].ToString(), font2, Brushes.Red, x, - Count1[] - ); x = x + ;
g.FillRectangle(mybrush2, x, - Count2[], , Count2[]);
g.DrawString(Count2[].ToString(), font2, Brushes.Green, x, - Count2[] - ); //第三期
x = x + ;
g.FillRectangle(mybrush, x, - Count1[], , Count1[]);
g.DrawString(Count1[].ToString(), font2, Brushes.Red, x, - Count1[] - ); x = x + ;
g.FillRectangle(mybrush2, x, - Count2[], , Count2[]);
g.DrawString(Count2[].ToString(), font2, Brushes.Green, x, - Count2[] - ); //第四期
x = x + ;
g.FillRectangle(mybrush, x, - Count1[], , Count1[]);
g.DrawString(Count1[].ToString(), font2, Brushes.Red, x, - Count1[] - ); x = x + ;
g.FillRectangle(mybrush2, x, - Count2[], , Count2[]);
g.DrawString(Count2[].ToString(), font2, Brushes.Green, x, - Count2[] - ); //上半年
x = x + ;
g.FillRectangle(mybrush, x, - Count1[], , Count1[]);
g.DrawString(Count1[].ToString(), font2, Brushes.Red, x, - Count1[] - ); x = x + ;
g.FillRectangle(mybrush2, x, - Count2[], , Count2[]);
g.DrawString(Count2[].ToString(), font2, Brushes.Green, x, - Count2[] - ); //下半年
x = x + ;
g.FillRectangle(mybrush, x, - Count1[], , Count1[]);
g.DrawString(Count1[].ToString(), font2, Brushes.Red, x, - Count1[] - ); x = x + ;
g.FillRectangle(mybrush2, x, - Count2[], , Count2[]);
g.DrawString(Count2[].ToString(), font2, Brushes.Green, x, - Count2[] - ); //全年
x = x + ;
g.FillRectangle(mybrush, x, - Count1[], , Count1[]);
g.DrawString(Count1[].ToString(), font2, Brushes.Red, x, - Count1[] - ); x = x + ;
g.FillRectangle(mybrush2, x, - Count2[], , Count2[]);
g.DrawString(Count2[].ToString(), font2, Brushes.Green, x, - Count2[] - ); //绘制标识
Font font3 = new System.Drawing.Font("Arial", , FontStyle.Regular);
g.DrawRectangle(new Pen(Brushes.Blue), , , , ); //绘制范围框
g.FillRectangle(Brushes.Red, , , , ); //绘制小矩形
g.DrawString("报名人数", font3, Brushes.Red, , ); g.FillRectangle(Brushes.Green, , , , );
g.DrawString("通过人数", font3, Brushes.Green, , ); System.IO.MemoryStream ms = new System.IO.MemoryStream();
image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
Response.ClearContent();
Response.ContentType = "image/Jpeg";
Response.BinaryWrite(ms.ToArray());
}
finally
{
g.Dispose();
image.Dispose();
}
}

二. 折线统计图的绘制

效果:

折线图的完整代码:

private void CreateImage()
{
int height = , width = ;
Bitmap image = new Bitmap(width, height);
Graphics g = Graphics.FromImage(image); try
{
//清空图片背景色
g.Clear(Color.White); Font font = new System.Drawing.Font("Arial", , FontStyle.Regular);
Font font1 = new System.Drawing.Font("宋体", , FontStyle.Regular);
Font font2 = new System.Drawing.Font("Arial", , FontStyle.Regular);
LinearGradientBrush brush = new LinearGradientBrush(
new Rectangle(, , image.Width, image.Height), Color.Blue, Color.Blue, 1.2f, true);
g.FillRectangle(Brushes.AliceBlue, , , width, height);
Brush brush1 = new SolidBrush(Color.Blue);
Brush brush2 = new SolidBrush(Color.SaddleBrown); g.DrawString(this.ddlTaget.SelectedItem.Text + " " + this.ddlYear.SelectedItem.Text +
" 成绩统计折线图", font1, brush1, new PointF(, ));
//画图片的边框线
g.DrawRectangle(new Pen(Color.Blue), , , image.Width - , image.Height - ); Pen mypen = new Pen(brush, );
Pen mypen2 = new Pen(Color.Red, );
//绘制线条
//绘制纵向线条
int x = ;
for (int i = ; i < ; i++)
{
g.DrawLine(mypen, x, , x, );
x = x + ;
}
Pen mypen1 = new Pen(Color.Blue, );
x = ;
g.DrawLine(mypen1, x, , x, ); //绘制横向线条
int y = ;
for (int i = ; i < ; i++)
{
g.DrawLine(mypen, , y, , y);
y = y + ;
}
// y = 106;
g.DrawLine(mypen1, , y - , , y - ); //x轴
String[] n = { "第一期", "第二期", "第三期", "第四期", "上半年", "下半年", "全年统计" };
x = ;
for (int i = ; i < ; i++)
{
g.DrawString(n[i].ToString(), font, Brushes.Red, x, ); //设置文字内容及输出位置
x = x + ;
} //y轴
String[] m = { "220人", " 200人", " 175人", "150人", " 125人", " 100人", " 75人", " 50人",
" 25人"};
y = ;
for (int i = ; i < ; i++)
{
g.DrawString(m[i].ToString(), font, Brushes.Red, , y); //设置文字内容及输出位置
y = y + ;
} int[] Count1 = new int[];
int[] Count2 = new int[]; SqlConnection Con = new SqlConnection("Server=(Local);Database=committeeTraining;Uid=sa;Pwd=eesoft");
Con.Open();
string cmdtxt2 = "SELECT * FROM ##Count where Company='" + this.ddlTaget.SelectedItem.Text.Trim() + "'";
SqlDataAdapter da = new SqlDataAdapter(cmdtxt2, Con);
DataSet ds = new DataSet();
da.Fill(ds); //报名人数
Count1[] = Convert.ToInt32(ds.Tables[].Rows[]["count1"].ToString());
Count1[] = Convert.ToInt32(ds.Tables[].Rows[]["count3"].ToString());
Count1[] = Convert.ToInt32(ds.Tables[].Rows[]["count5"].ToString());
Count1[] = Convert.ToInt32(ds.Tables[].Rows[]["count7"].ToString()); Count1[] = Convert.ToInt32(ds.Tables[].Rows[]["count9"].ToString()); //全年 Count1[] = Count1[] + Count1[];
Count1[] = Count1[] + Count1[]; Count2[] = Convert.ToInt32(ds.Tables[].Rows[]["count2"].ToString());
Count2[] = Convert.ToInt32(ds.Tables[].Rows[]["count4"].ToString());
Count2[] = Convert.ToInt32(ds.Tables[].Rows[]["count6"].ToString());
Count2[] = Convert.ToInt32(ds.Tables[].Rows[]["count8"].ToString()); Count2[] = Convert.ToInt32(ds.Tables[].Rows[]["count10"].ToString()); //全年 Count2[] = Count2[] + Count2[];
Count2[] = Count2[] + Count2[]; //显示折线效果
Font font3 = new System.Drawing.Font("Arial", , FontStyle.Bold);
SolidBrush mybrush = new SolidBrush(Color.Red);
Point[] points1 = new Point[];
points1[].X = ; points1[].Y = - Count1[]; //从106纵坐标开始, 到(0, 0)坐标时
points1[].X = ; points1[].Y = - Count1[];
points1[].X = ; points1[].Y = - Count1[];
points1[].X = ; points1[].Y = - Count1[]; points1[].X = ; points1[].Y = - Count1[];
points1[].X = ; points1[].Y = - Count1[]; points1[].X = ; points1[].Y = - Count1[];
g.DrawLines(mypen2, points1); //绘制折线 //绘制数字
g.DrawString(Count1[].ToString(), font3, Brushes.Red, , points1[].Y - );
g.DrawString(Count1[].ToString(), font3, Brushes.Red, , points1[].Y - );
g.DrawString(Count1[].ToString(), font3, Brushes.Red, , points1[].Y - );
g.DrawString(Count1[].ToString(), font3, Brushes.Red, , points1[].Y - ); g.DrawString(Count1[].ToString(), font3, Brushes.Red, , points1[].Y - );
g.DrawString(Count1[].ToString(), font3, Brushes.Red, , points1[].Y - ); g.DrawString(Count1[].ToString(), font3, Brushes.Red, , points1[].Y - ); Pen mypen3 = new Pen(Color.Green, );
Point[] points2 = new Point[];
points2[].X = ; points2[].Y = - Count2[];
points2[].X = ; points2[].Y = - Count2[];
points2[].X = ; points2[].Y = - Count2[];
points2[].X = ; points2[].Y = - Count2[]; points2[].X = ; points2[].Y = - Count2[];
points2[].X = ; points2[].Y = - Count2[]; points2[].X = ; points2[].Y = - Count2[];
g.DrawLines(mypen3, points2); //绘制折线 //绘制通过人数
g.DrawString(Count2[].ToString(), font3, Brushes.Green, , points2[].Y - );
g.DrawString(Count2[].ToString(), font3, Brushes.Green, , points2[].Y - );
g.DrawString(Count2[].ToString(), font3, Brushes.Green, , points2[].Y - );
g.DrawString(Count2[].ToString(), font3, Brushes.Green, , points2[].Y - ); g.DrawString(Count2[].ToString(), font3, Brushes.Green, , points2[].Y - );
g.DrawString(Count2[].ToString(), font3, Brushes.Green, , points2[].Y - ); g.DrawString(Count2[].ToString(), font3, Brushes.Green, , points2[].Y - ); //绘制标识
g.DrawRectangle(new Pen(Brushes.Red), , , , ); //绘制范围框
g.FillRectangle(Brushes.Red, , , , ); //绘制小矩形
g.DrawString("报名人数", font2, Brushes.Red, , ); g.FillRectangle(Brushes.Green, , , , );
g.DrawString("通过人数", font2, Brushes.Green, , ); System.IO.MemoryStream ms = new System.IO.MemoryStream();
image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
Response.ClearContent();
Response.ContentType = "image/Jpeg";
Response.BinaryWrite(ms.ToArray());
}
finally
{
g.Dispose();
image.Dispose();
}
}

三. 扇形统计图的绘制

效果图:

扇形图完整代码:

private void CreateImage()
{
//把连接字串指定为一个常量
SqlConnection Con = new SqlConnection("Server=(Local);
Database=committeeTraining;Uid=sa;Pwd=**");
Con.Open();
string cmdtxt = selectString; // "select * from ##Count"; //
//SqlCommand Com = new SqlCommand(cmdtxt, Con);
DataSet ds = new DataSet();
SqlDataAdapter Da = new SqlDataAdapter(cmdtxt, Con);
Da.Fill(ds);
Con.Close();
float Total = 0.0f, Tmp; //转换成单精度。也可写成Convert.ToInt32
Total = Convert.ToSingle(ds.Tables[].Rows[][this.count[]]); // Total=Convert.ToSingle(ds.Tables[0].Rows[0][this.count[0]]);
//设置字体,fonttitle为主标题的字体
Font fontlegend = new Font("verdana", );
Font fonttitle = new Font("verdana", , FontStyle.Bold); //背景宽
int width = ;
int bufferspace = ;
int legendheight = fontlegend.Height * + bufferspace; //高度
int titleheight = fonttitle.Height + bufferspace;
int height = width + legendheight + titleheight + bufferspace;//白色背景高
int pieheight = width;
Rectangle pierect = new Rectangle(, titleheight, width, pieheight); //加上各种随机色
ArrayList colors = new ArrayList();
Random rnd = new Random();
for (int i = ; i < ; i++)
colors.Add(new SolidBrush(Color.FromArgb(rnd.Next(), rnd.Next(), rnd.Next()))); //创建一个bitmap实例
Bitmap objbitmap = new Bitmap(width, height);
Graphics objgraphics = Graphics.FromImage(objbitmap); //画一个白色背景
objgraphics.FillRectangle(new SolidBrush(Color.White), , , width, height); //画一个亮黄色背景
objgraphics.FillRectangle(new SolidBrush(Color.Beige), pierect); //以下为画饼图(有几行row画几个)
float currentdegree = 0.0f; //画通过人数
objgraphics.FillPie((SolidBrush)colors[], pierect, currentdegree,
Convert.ToSingle(ds.Tables[].Rows[][this.count[]]) / Total * );
currentdegree += Convert.ToSingle(ds.Tables[].Rows[][this.count[]]) / Total * ; //未通过人数饼状图
objgraphics.FillPie((SolidBrush)colors[], pierect, currentdegree,
((Convert.ToSingle(ds.Tables[].Rows[][this.count[]]))-(Convert.ToSingle(ds.Tables[].Rows[][this.count[]]))) / Total * );
currentdegree += ((Convert.ToSingle(ds.Tables[].Rows[][this.count[]])) -
(Convert.ToSingle(ds.Tables[].Rows[][this.count[]]))) / Total * ; //以下为生成主标题
SolidBrush blackbrush = new SolidBrush(Color.Black);
SolidBrush bluebrush = new SolidBrush(Color.Blue);
string title = " 机关单位成绩统计饼状图: "
+ "\n \n\n";
StringFormat stringFormat = new StringFormat();
stringFormat.Alignment = StringAlignment.Center;
stringFormat.LineAlignment = StringAlignment.Center; objgraphics.DrawString(title, fonttitle, blackbrush,
new Rectangle(, , width, titleheight), stringFormat); //列出各字段与得数目
objgraphics.DrawRectangle(new Pen(Color.Red, ), , height + - legendheight, width, legendheight + ); objgraphics.DrawString("----------------统计信息------------------",
fontlegend, bluebrush, , height - legendheight + fontlegend.Height * + );
objgraphics.DrawString("统计单位: " + this.ddlTaget.SelectedItem.Text,
fontlegend, blackbrush, , height - legendheight + fontlegend.Height * + );
objgraphics.DrawString("统计年份: " + this.ddlYear.SelectedItem.Text,
fontlegend, blackbrush, , height - legendheight + fontlegend.Height * + );
objgraphics.DrawString("统计期数: " + this.ddlSpan.SelectedItem.Text,
fontlegend, blackbrush, , height - legendheight + fontlegend.Height * + ); objgraphics.FillRectangle((SolidBrush)colors[], ,height - legendheight + fontlegend.Height * + , , );
objgraphics.DrawString("报名总人数: " + Convert.ToString(Convert.ToSingle(ds.Tables[].Rows[][this.count[]])),
fontlegend, blackbrush, , height - legendheight + fontlegend.Height * + );
objgraphics.FillRectangle((SolidBrush)colors[], , height - legendheight + fontlegend.Height * + , , );
objgraphics.DrawString("通过总人数: " + Convert.ToString(Convert.ToSingle(ds.Tables[].Rows[][this.count[]])),
fontlegend, blackbrush, , height - legendheight + fontlegend.Height * + );
objgraphics.DrawString("未通过人数: " + ((Convert.ToSingle(ds.Tables[].Rows[][this.count[]])) -
(Convert.ToSingle(ds.Tables[].Rows[][this.count[]]))), fontlegend, blackbrush, , height - legendheight + fontlegend.Height * + ); objgraphics.DrawString("通过率: " + Convert.ToString((Convert.ToSingle(ds.Tables[].Rows[][this.count[]]) /
Convert.ToSingle(ds.Tables[].Rows[][this.count[]])) * )+ " %", fontlegend,
blackbrush, , height - legendheight + fontlegend.Height * + ); Response.ContentType = "image/Jpeg";
objbitmap.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
objgraphics.Dispose();
objbitmap.Dispose(); }

这里的统计图直接输出到网页, 如果大家需要制作 winForm 上需要显示的统计图。可参考我之前写的:

C#制作艺术字

C#完成超酷的图像效果 (附demo)

出处:http://www.cnblogs.com/ziyiFly/archive/2008/09/24/1297841.html

C# 绘制统计图(柱状图, 折线图, 扇形图)的更多相关文章

  1. C# 绘制统计图(柱状图, 折线图, 扇形图)【转载】

    统计图形种类繁多, 有柱状图, 折线图, 扇形图等等, 而统计图形的绘制方法也有很多, 有Flash制作的统计图形, 有水晶报表生成统计图形, 有专门制图软件制作, 也有编程语言自己制作的:这里我们用 ...

  2. Asp.net 用 Graphics 统计图(柱状图, 折线图, 扇形图)

    统计图形种类繁多, 有柱状图, 折线图, 扇形图等等, 而统计图形的绘制方法也有很多, 有Flash制作的统计图形, 有水晶报表生成统计图形, 有专门制图软件制作, 也有编程语言自己制作的:这里我们用 ...

  3. 06. Matplotlib 2 |折线图| 柱状图| 堆叠图| 面积图| 填图| 饼图| 直方图| 散点图| 极坐标| 图箱型图

    1.基本图表绘制 plt.plot() 图表类别:线形图.柱状图.密度图,以横纵坐标两个维度为主同时可延展出多种其他图表样式 plt.plot(kind='line', ax=None, figsiz ...

  4. Qt数据可视化(散点图、折线图、柱状图、盒须图、饼状图、雷达图)开发实例

    ​  目录 散点图 折线图 柱状图 水平柱状图 水平堆叠图 水平百分比柱状图 盒须图 饼状图 雷达图 Qt散点图.折线图.柱状图.盒须图.饼状图.雷达图开发实例. 在开发过程中我们会使用多各种各样的图 ...

  5. 前端数据统计用做Bootstrap的一些柱状图、饼状图和折线图案例

    Bootstrap,来自 Twitter,是目前最受欢迎的前端框架.Bootstrap 是基于 HTML.CSS.JAVASCRIPT 的,它简洁灵活,使得 Web 开发更加快捷. Bootstrap ...

  6. WPF、Silverlight项目中使用柱状图、饼状图、折线图

    在开发的过程中,可能会遇到柱状图.饼状图.折线图来更好的显示数据,最近整理了一下,遂放出来望需要的朋友可以参考.本文仅仅是简单显示,如需复杂显示效果请参考官网代码示例.----本文代码使用WPF,Si ...

  7. High-speed Charting Control--MFC绘制图表(折线图、饼图、柱形图)控件

    原文地址:https://www.codeproject.com/articles/14075/high-speed-charting-control 本文翻译在CodeProject上的介绍(主要还 ...

  8. 数据输入——生成你需要的echart图(堆积柱状图、扇形图、嵌套环形图)

    最近论文需要一些比较直观的图表, 发现echart做出来的图还是比较美观的,这里介绍如何修改数据生成你需要的echart图. 1.堆积柱状图: http://echarts.baidu.com/exa ...

  9. Chart图表整合——面积对比图、扇形图、柱状图

    一. chart图表demo网址 网址:http://antv.alipay.com/zh-cn/f2/3.x/demo/index.html 二. 本文主要对面积对比图,扇形图,柱状图三大常见图进行 ...

随机推荐

  1. Eclipse中安装可以新建html文件的插件(Eclipse HTML Editor)

    最近在eclipse中开发android项目,用到了jquery mobile框架,则会涉及到新建html文件,发现eclipse不自带新建html文件的插件,必须得新建一个其他形式的文件,譬如xml ...

  2. linux apache 配置fastcgi

    Redhat 上 FastCGI 安装与配置 软件包 相关软件包: httpd 2.2.14      //注意版本 这个版本不会出问题   注:apache httpd安装 fcgi-2.4.0.t ...

  3. Asp.net 身份验证方式?

    [Forms 身份验证] 通过其可将没有通过身份验证的请求重定向到使用 HTTP 客户端重定向的 HTML 窗体的系统.用户提供凭据并提交该窗体.如果应用程序验证该请求,系统就会发出包含凭据或密钥的 ...

  4. ylb:多表的连接与练习(第三方关联表的应用)

    ylbtech-SQL Server:SQL Server-多表的连接与练习(第三方关联表的应用) SQL Server 多表的连接与练习(第三方关联表的应用). 1,多表的连接与练习(第三方关联表的 ...

  5. PHP开发规范

    十.开发规范下面我们讲解 Yii 编程中推荐的开发规范.为简单起见,我们假设 WebRoot 是 Yii 应用安装的目录.1.URL默认情况下,Yii 识别如下格式的 URL: http://host ...

  6. 用代码将Excel数据导入Sql Server

    这里直接用小例子说明. 1.打开VS2010—>文件—>新建—>网站,选择ASP.NET空网站并设置存放路径以创建空网站.(我这里路径设置为D:\excelEduceToSql) 2 ...

  7. 为什么使用开源软件(Open Source Software)

    国产软件的流氓化看起来已经蔚然成风,在安装到电脑之后,它们就不想再离开,甚至它们还想将同一家族的产品通过后台下载全部推送给你.搜狗输入法最近就被发现悄悄推送了搜狗浏览器. 一位用户用 debugvie ...

  8. bzoj 3757 苹果树(树上莫队算法)

    [题意] 有若干个询问,询问路径u,v上的颜色总数,另外有要求a,b,意为将a颜色看作b颜色. [思路] vfk真是神系列233. Quote: 用S(v, u)代表 v到u的路径上的结点的集合. 用 ...

  9. 字符串和数组中split().toString(),join(),splice(),slice(),substr()和substring()

    <!Doctype html> <head> <mate charset="utf-8"> <title>string change ...

  10. vim7.4 安装 k-vim

    注:在虚拟机 kali 1.9中安装完成之后,无法连接到网络(目前没找到有效的解决方法,不知道是不是通病,本人安装了两次,都一样),cpu占用率 70%+  ,建议安装之前,先建立快照,否则,后悔莫极 ...