
如何让公司名字后面带上统计金额数量
下面是我的代码,怎样修改呢?
Dim
Chart
As
WinForm.Chart
'定义一个图表变量
Dim
Series
As
WinForm.ChartSeries
'定义一个图系变量
Dim
tbl
As
DataTable
=
DataTables("支付单位维度表")
'定义一个变量tbl引用数据表
Dim
lst
As
List(Of
String) =
tbl.GetValues("支公司")
'获得产品名称集合
Dim
sm
As
Integer
=
tbl.Compute("count(本次拟支付金额)")
'计算总数量
Chart
=
e.Form.Controls("Chart2")
' 引用窗口中的图表
Chart.AxisX.ClearValueLabel
' 清除图表原来的
Chart.SeriesList.Clear()
'清除图表原来的图系
Chart.VisualEffect
=
True
Chart.ChartType
=
ChartTypeEnum.pie
'设置图表类型
For
Each
gys
As
String
In
lst
Series
=
Chart.SeriesList.Add()
'增加一个图系
Series.Length
=
1
'一个系列只能包括一个值
Series.Text
=
gys
Series.Y(0) =
tbl.Compute("count(支公司)",
"支公司='"
&
gys
&
"'")
Series.DataLabelText
=
Math.Round(Series.Y(0)*100/sm,2)
&
"%"
'计算百分比
Next
Chart.LegendVisible
=
True
'显示图列
Chart.LegendCompass=
CompassEnum.East
'图列显示在东方(右方)