1.什么是MSChart
2.Line Charts
1
1
)
string
strSql
=
"
SELECT Top 5 empid, COUNT(*) AS lNum FROM log where empid <> '' GROUP BY empid ORDER BY empid
"
;
2
DataSet ds
=
SqlHelper.ExecuteDataset(strConnISPD, CommandType.Text, strSql);
3
DataView dv
=
new
DataView(ds.Tables[
0
]);
4
Chart1.Series[
"
login
"
].Points.DataBindXY(dv,
"
empid
"
, dv,
"
lNum
"
);
5
2
) SqlCommand cd
=
new
SqlCommand(strSql, conn);
6
SqlDataAdapter da
=
new
SqlDataAdapter();
7
da.SelectCommand
=
cd;
8
DataSet ds
=
new
DataSet();
9
da.Fill(ds,
"
log
"
);
10
DataView dv
=
new
DataView(ds.Tables[
0
]);
11
dv.Sort
=
"
empid
"
;
12
Chart1.Series[
"
login
"
].Points.DataBindXY(dv,
"
empid
"
, dv,
"
lNum
"
);
1
double
[] yValues
=
{
12
,
67
,
45
,
double
.NaN,
67
,
89
,
35
,
12
,
78
,
54
};
2
double
[] xValues
=
{
1990
,
1991
,
1992
,
1993
,
1994
,
1995
,
1996
,
1997
,
1998
,
1999
};
3
Chart1.Series[
"
Series1
"
].Points.DataBindXY(xValues, yValues);